| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602 |
- Index: apt-pkg/deb/debsystem.cc
- --- apt-pkg/deb/debsystem.cc.orig 2003-11-24 17:58:46.000000000 +0100
- +++ apt-pkg/deb/debsystem.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -162,7 +162,7 @@
- be the only users of these */
- Cnf.CndSet("Dir::State::userstatus","status.user"); // Defunct
- Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status");
- - Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg");
- + Cnf.CndSet("Dir::Bin::dpkg","@l_prefix@/bin/dpkg");
-
- return true;
- }
- @@ -187,7 +187,7 @@
- signed Score = 0;
- if (FileExists(Cnf.FindFile("Dir::State::status","/var/lib/dpkg/status")) == true)
- Score += 10;
- - if (FileExists(Cnf.FindFile("Dir::Bin::dpkg","/usr/bin/dpkg")) == true)
- + if (FileExists(Cnf.FindFile("Dir::Bin::dpkg","@l_prefix@/bin/dpkg")) == true)
- Score += 10;
- if (FileExists("/etc/debian_version") == true)
- Score += 10;
- Index: apt-pkg/init.cc
- --- apt-pkg/init.cc.orig 2003-11-24 17:58:44.000000000 +0100
- +++ apt-pkg/init.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -45,10 +45,10 @@
- Cnf.Set("APT::Architecture",COMMON_OS "-" COMMON_CPU);
- // CNC:2002-09-10
- //Cnf.Set("APT::Build-Essential::", "build-essential");
- - Cnf.Set("Dir","/");
- + Cnf.Set("Dir","@l_prefix@");
-
- // State
- - Cnf.Set("Dir::State","var/lib/apt/");
- + Cnf.Set("Dir::State","var/@name@/lib/");
-
- /* Just in case something goes horribly wrong, we can fall back to the
- old /var/state paths.. */
- @@ -61,13 +61,13 @@
- Cnf.Set("Dir::State::cdroms","cdroms.list");
-
- // Cache
- - Cnf.Set("Dir::Cache","var/cache/apt/");
- + Cnf.Set("Dir::Cache","var/@name@/cache/");
- Cnf.Set("Dir::Cache::archives","archives/");
- Cnf.Set("Dir::Cache::srcpkgcache","srcpkgcache.bin");
- Cnf.Set("Dir::Cache::pkgcache","pkgcache.bin");
-
- // Configuration
- - Cnf.Set("Dir::Etc","etc/apt/");
- + Cnf.Set("Dir::Etc","etc/@name@/");
- Cnf.Set("Dir::Etc::sourcelist","sources.list");
- // CNC:2003-03-03
- Cnf.Set("Dir::Etc::sourceparts","sources.list.d");
- @@ -76,7 +76,7 @@
- Cnf.Set("Dir::Etc::main","apt.conf");
- Cnf.Set("Dir::Etc::parts","apt.conf.d");
- Cnf.Set("Dir::Etc::preferences","preferences");
- - Cnf.Set("Dir::Bin::methods",LIBDIR "/apt/methods");
- + Cnf.Set("Dir::Bin::methods","@l_prefix@/lib/apt/methods");
- Cnf.Set("Acquire::ComprExtension", ".bz2");
-
- bool Res = true;
- Index: apt-pkg/luaiface.cc
- --- apt-pkg/luaiface.cc.orig 2003-11-24 17:58:50.000000000 +0100
- +++ apt-pkg/luaiface.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -61,7 +61,7 @@
- Lua::Lua()
- : DepCache(0), Cache(0), CacheControl(0), Fix(0), DontFix(0)
- {
- - _config->CndSet("Dir::Bin::scripts", "/usr/lib/apt/scripts");
- + _config->CndSet("Dir::Bin::scripts", "@l_prefix@/lib/apt/scripts");
-
- const luaL_reg lualibs[] = {
- {"base", luaopen_base},
- Index: apt-pkg/rpm/rpmhandler.h
- --- apt-pkg/rpm/rpmhandler.h.orig 2003-11-24 17:58:54.000000000 +0100
- +++ apt-pkg/rpm/rpmhandler.h 2003-11-28 21:06:52.000000000 +0100
- @@ -12,6 +12,7 @@
-
- #include <apt-pkg/fileutl.h>
-
- +#include <rpm/glob.h>
- #include <rpm/rpmlib.h>
- #include <rpm/rpmmacro.h>
-
- Index: apt-pkg/rpm/rpmindexfile.cc
- --- apt-pkg/rpm/rpmindexfile.cc.orig 2003-11-24 17:58:58.000000000 +0100
- +++ apt-pkg/rpm/rpmindexfile.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -58,7 +58,7 @@
- Res = URI;
- }
- else
- - Res = URI + Dist + "/base/";
- + Res = URI + Dist + "/";
-
- Res += Type;
-
- @@ -145,7 +145,7 @@
- Res = URI;
- }
- else
- - Res = URI + Dist + "/base/";
- + Res = URI + Dist + "/";
-
- Res += Type + '.' + Section;
-
- @@ -277,8 +277,8 @@
- if (Repository->IsAuthenticated() == true &&
- Repository->HasRelease() == false)
- return true;
- - new pkgAcqIndex(Owner,Repository,IndexURI("srclist"),Info("srclist"),
- - "srclist");
- + new pkgAcqIndex(Owner,Repository,IndexURI("00INDEX.apt-srclist"),Info("00INDEX.apt-srclist"),
- + "00INDEX.apt-srclist");
- return true;
- }
- /*}}}*/
- @@ -347,10 +347,10 @@
- if (Repository->IsAuthenticated() == true &&
- Repository->HasRelease() == false)
- return true;
- - new pkgAcqIndex(Owner,Repository,IndexURI("pkglist"),Info("pkglist"),
- - "pkglist");
- - new pkgAcqIndexRel(Owner,Repository,IndexURI("release"),Info("release"),
- - "release");
- + new pkgAcqIndex(Owner,Repository,IndexURI("00INDEX.apt-pkglist"),Info("00INDEX.apt-pkglist"),
- + "00INDEX.apt-pkglist");
- + new pkgAcqIndexRel(Owner,Repository,IndexURI("00INDEX.apt-release"),Info("00INDEX.apt-release"),
- + "00INDEX.apt-release");
- return true;
- }
- /*}}}*/
- @@ -424,7 +424,7 @@
- return _error->Error(_("Problem opening %s"),PackageFile.c_str());
- }
- // We call SubProgress with Size(), since we won't call SelectFile() here.
- - Prog.SubProgress(Size(),Info("pkglist"));
- + Prog.SubProgress(Size(),Info("00INDEX.apt-pkglist"));
- if (Gen.MergeFileProvides(Parser) == false)
- return _error->Error(_("Problem with MergeFileProvides %s"),
- PackageFile.c_str());
- Index: apt-pkg/rpm/rpmindexfile.h
- --- apt-pkg/rpm/rpmindexfile.h.orig 2003-11-24 17:58:58.000000000 +0100
- +++ apt-pkg/rpm/rpmindexfile.h 2003-11-28 21:06:52.000000000 +0100
- @@ -140,7 +140,7 @@
- {
- protected:
-
- - virtual string MainType() const {return "srclist";}
- + virtual string MainType() const {return "00INDEX.apt-srclist";}
-
- public:
-
- Index: apt-pkg/rpm/rpmpackagedata.cc
- --- apt-pkg/rpm/rpmpackagedata.cc.orig 2003-11-24 17:58:55.000000000 +0100
- +++ apt-pkg/rpm/rpmpackagedata.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -12,6 +12,7 @@
-
- #include <apti18n.h>
-
- +#include <rpm/glob.h>
- #include <rpm/rpmlib.h>
-
- RPMPackageData::RPMPackageData()
- Index: apt-pkg/rpm/rpmpm.cc
- --- apt-pkg/rpm/rpmpm.cc.orig 2003-11-24 17:58:53.000000000 +0100
- +++ apt-pkg/rpm/rpmpm.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -34,6 +34,7 @@
- #include <stdio.h>
- #include <iostream>
-
- +#include <rpm/glob.h>
- #ifdef HAVE_RPM41
- #include <rpm/rpmdb.h>
- #define packagesTotal rpmcliPackagesTotal
- Index: apt-pkg/rpm/rpmpm.h
- --- apt-pkg/rpm/rpmpm.h.orig 2003-11-24 17:58:54.000000000 +0100
- +++ apt-pkg/rpm/rpmpm.h 2003-11-28 21:06:52.000000000 +0100
- @@ -11,6 +11,7 @@
- #ifndef PKGLIB_rpmPM_H
- #define PKGLIB_rpmPM_H
-
- +#include <rpm/glob.h>
- #include <rpm/rpmlib.h>
- #ifdef HAVE_RPM41
- #include <rpm/rpmts.h>
- Index: apt-pkg/rpm/rpmrecords.h
- --- apt-pkg/rpm/rpmrecords.h.orig 2003-11-24 17:58:57.000000000 +0100
- +++ apt-pkg/rpm/rpmrecords.h 2003-11-28 21:06:52.000000000 +0100
- @@ -21,6 +21,7 @@
-
- #include <apt-pkg/pkgrecords.h>
- #include <apt-pkg/fileutl.h>
- +#include <rpm/glob.h>
- #include <rpm/rpmlib.h>
-
-
- Index: apt-pkg/rpm/rpmsrcrecords.h
- --- apt-pkg/rpm/rpmsrcrecords.h.orig 2003-11-24 17:58:58.000000000 +0100
- +++ apt-pkg/rpm/rpmsrcrecords.h 2003-11-28 21:06:52.000000000 +0100
- @@ -17,6 +17,7 @@
-
- #include <apt-pkg/srcrecords.h>
- #include <apt-pkg/fileutl.h>
- +#include <rpm/glob.h>
- #include <rpm/rpmlib.h>
-
-
- Index: apt-pkg/rpm/rpmsystem.cc
- --- apt-pkg/rpm/rpmsystem.cc.orig 2003-11-24 17:58:54.000000000 +0100
- +++ apt-pkg/rpm/rpmsystem.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -123,12 +123,12 @@
- /* These are the rpm specific configuration variables.. */
- bool rpmSystem::Initialize(Configuration &Cnf)
- {
- - Cnf.CndSet("Dir::Bin::rpm","/bin/rpm");
- + Cnf.CndSet("Dir::Bin::rpm","@l_bindir@/rpm");
- Cnf.CndSet("Dir::Etc::rpmpriorities", "rpmpriorities");
- Cnf.CndSet("Dir::Etc::translatelist", "translate.list");
- Cnf.CndSet("Dir::Etc::translateparts", "translate.list.d");
- Cnf.CndSet("Dir::State::prefetch", "prefetch");
- - Cnf.CndSet("Dir::Locale","/usr/share/locale");
- + Cnf.CndSet("Dir::Locale","@l_prefix@/share/locale");
- Cnf.CndSet("Acquire::DistroID","Conectiva"); // hee hee
- Cnf.CndSet("Acquire::CDROM::Mount", "/mnt/cdrom");
- Cnf.CndSet("Acquire::CDROM::Copy-All", "true");
- @@ -200,7 +200,7 @@
-
- if (FileExists(RPMDBHandler::DataPath(false)))
- Score += 10;
- - if (FileExists(Cnf.FindFile("Dir::Bin::rpm","/bin/rpm")) == true)
- + if (FileExists(Cnf.FindFile("Dir::Bin::rpm","@l_bindir@/rpm")) == true)
- Score += 10;
-
- return Score;
- Index: apt-pkg/rpm/rpmversion.cc
- --- apt-pkg/rpm/rpmversion.cc.orig 2003-11-24 17:58:55.000000000 +0100
- +++ apt-pkg/rpm/rpmversion.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -22,6 +22,7 @@
- #include <apt-pkg/rpmversion.h>
- #include <apt-pkg/pkgcache.h>
-
- +#include <rpm/glob.h>
- #include <rpm/rpmlib.h>
- #include <rpm/misc.h>
-
- Index: apt-pkg/sourcelist.cc
- --- apt-pkg/sourcelist.cc.orig 2003-11-24 17:58:39.000000000 +0100
- +++ apt-pkg/sourcelist.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -105,7 +105,7 @@
- // Check for an absolute dists specification.
- if (Dist.empty() == false && Dist[Dist.size() - 1] == '/')
- {
- - if (ParseQuoteWord(Buffer,Section) == true)
- + if (ParseQuoteWord(Buffer,Section) == false)
- return _error->Error(_("Malformed line %lu in source list %s (Absolute dist)"),CurLine,File.c_str());
- Dist = SubstVar(Dist,"$(ARCH)",_config->Find("APT::Architecture"));
- return CreateItem(List,URI,Dist,Section,Vendor);
- Index: configure.in
- --- configure.in.orig 2003-11-24 17:58:30.000000000 +0100
- +++ configure.in 2003-11-28 21:06:52.000000000 +0100
- @@ -48,14 +48,14 @@
- AC_CHECK_HEADER(rpm/rpmlib.h,
- [
- AC_CHECK_LIB(rpmdb,rpmdbOpen,
- - [RPMDBLIBS="-lrpmdb"],
- + [RPMDBLIBS="@rpmlibs@"],
- [RPMDBLIBS="-ldb-3.1"],
- - [-lrpm -lrpmio -lz -lbz2 -lpopt])
- + [@rpmlibs@ @l_rpmlibs@])
-
- AC_CHECK_LIB(rpm,rpmdbGetIteratorOffset,
- [AC_DEFINE_UNQUOTED(HAVE_RPM, 1)
- AC_DEFINE_UNQUOTED(HAVE_RPM4, 1)
- - RPMLIBS="-lrpm $RPMDBLIBS -lrpmio -lz -lbz2 -lpopt"
- + RPMLIBS="@rpmlibs@ $RPMDBLIBS @l_rpmlibs@"
- AC_CHECK_LIB(rpm, rpmtsUpdateDSI,
- [AC_DEFINE_UNQUOTED(HAVE_RPM41, 1)
- rpm_version="4.1"],
- @@ -64,11 +64,11 @@
- ],
- [AC_CHECK_LIB(rpm,rpmdbFirstRecNum,
- [AC_DEFINE_UNQUOTED(HAVE_RPM, 1)
- - RPMLIBS="-lrpm -ldb1 -lz -lbz2 -lpopt"
- + RPMLIBS="@rpmlibs@"
- rpm_version="3"],,
- - [-ldb1 -lz -lbz2 -lpopt])
- + [@rpmlibs@])
- ],
- - [$RPMDBLIBS -lrpmio -lz -lbz2 -lpopt])
- + [$RPMDBLIBS @rpmlibs@ @l_rpmlibs@])
-
- AC_SUBST(RPMLIBS)
- ])
- Index: methods/gpg.cc
- --- methods/gpg.cc.orig 2003-11-28 21:06:52.000000000 +0100
- +++ methods/gpg.cc 2003-11-28 21:07:38.000000000 +0100
- @@ -10,6 +10,11 @@
- #include <stdio.h>
- #include <sys/wait.h>
-
- +#ifdef OPENPKG_SOLARIS
- +#include <sys/syscall.h>
- +#include <sys/systm.h>
- +#endif
- +
- #include <apti18n.h>
-
- class GPGMethod : public pkgAcqMethod
- @@ -173,7 +178,81 @@
- }
- #undef STRCMP
-
- +#ifdef OPENPKG_SOLARIS
- +
- +static const char letters[] =
- +"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
- +
- +static int gen_tempname (char *tmpl)
- +{
- + int len;
- + char *XXXXXX;
- + static uint64_t value;
- + uint64_t random_time_bits;
- + int count, fd = -1;
- + int save_errno = errno;
- +
- + len = strlen(tmpl);
- + if ( len < 6 || strcmp (&tmpl[len - 6], "XXXXXX")) {
- + __set_errno(EINVAL);
- + return -1;
- + }
- +
- + XXXXXX = &tmpl[len - 6];
- + random_time_bits = time(NULL);
- + value += random_time_bits ^ getpid();
- +
- + for ( count = 0; count < TMP_MAX; value += 7777, ++count) {
- + uint64_t v = value;
- + XXXXXX[0] = letters[v % 62];
- + v /= 62;
- + XXXXXX[1] = letters[v % 62];
- + v /= 62;
- + XXXXXX[2] = letters[v % 62];
- + v /= 62;
- + XXXXXX[3] = letters[v % 62];
- + v /= 62;
- + XXXXXX[4] = letters[v % 62];
- + v /= 62;
- + XXXXXX[5] = letters[v % 62];
- +
- + fd = mkdir(tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
- +
- + if ( fd > 0 ) {
- + __set_errno(save_errno);
- + return fd;
- + }
- + else if ( errno != EEXIST ) {
- + return -1;
- + }
- +
- + }
- +
- + __set_errno(EEXIST);
- + return -1;
- +}
- +
- +static char *mkdtemp(char *templat)
- +{
- + if (gen_tempname (templat))
- + return NULL;
- + else
- + return templat;
- +}
- +
- +static void unsetenv(char *varname)
- +{
- + char *tempstr = (char *)malloc(strlen(varname) + 2);
- + if ( tempstr == (char *)NULL ) {
- + return;
- + }
- + sprintf(tempstr, "%s=", varname);
- + tempstr[strlen(varname) + 1] = '\0';
- + putenv(tempstr);
- + free(tempstr);
- +}
-
- +#endif /* OPENPKG_SOLARIS */
-
- char *getFileSigner(const char *file, const char *sigfile,
- const char *outfile, string &signerKeyID)
- Index: test/scratch.cc
- --- test/scratch.cc.orig 2003-11-24 17:57:07.000000000 +0100
- +++ test/scratch.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -51,7 +51,7 @@
-
- /* Db.GetFLCache().BeginDiverLoad();
- pkgFLCache::PkgIterator Pkg(Db.GetFLCache(),0);
- - if (Db.GetFLCache().AddDiversion(Pkg,"/usr/include/linux/kerneld.h","/usr/bin/nslookup") == false)
- + if (Db.GetFLCache().AddDiversion(Pkg,"/usr/include/linux/kerneld.h","@l_prefix@/bin/nslookup") == false)
- cerr << "Error!" << endl;
-
- const char *Tmp = "/usr/include/linux/kerneld.h";
- Index: tools/cached_md5.cc
- --- tools/cached_md5.cc.orig 2003-11-24 17:58:34.000000000 +0100
- +++ tools/cached_md5.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -1,11 +1,11 @@
- /*
- * $Id: cached_md5.cc,v 1.4 2003/01/29 13:47:31 niemeyer Exp $
- */
- -#include <alloca.h>
- #include <ctype.h>
- #include <dirent.h>
- #include <errno.h>
- #include <fcntl.h>
- +#include <rpm/glob.h>
- #include <rpm/rpmlib.h>
- #include <stdlib.h>
- #include <string.h>
- Index: tools/genpkglist.cc
- --- tools/genpkglist.cc.orig 2003-11-24 17:58:36.000000000 +0100
- +++ tools/genpkglist.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -1,11 +1,11 @@
- /*
- * $Id: genpkglist.cc,v 1.7 2003/01/30 17:18:21 niemeyer Exp $
- */
- -#include <alloca.h>
- #include <ctype.h>
- #include <dirent.h>
- #include <errno.h>
- #include <fcntl.h>
- +#include <rpm/glob.h>
- #include <rpm/rpmlib.h>
- #include <stdlib.h>
- #include <string.h>
- @@ -369,7 +369,7 @@
- }
-
- int scandir(const char * dir, struct dirent *** namelist,
- - int (* select)(struct dirent *),
- + int (* select)(const struct dirent *),
- int (* cmp)(const void *, const void *))
-
- {
- @@ -544,10 +544,10 @@
- rpmsdir = string(op_dir);
- }
- }
- - pkglist_path = string(rpmsdir);
- - rpmsdir = rpmsdir + "/RPMS." + string(op_suf);
- + pkglist_path = rpmsdir + "/" + string(op_suf);
- + rpmsdir = rpmsdir + "/" + string(op_suf);
-
- - string dirtag = "RPMS." + string(op_suf);
- + string dirtag = string(op_suf);
-
- entry_no = scandir(rpmsdir.c_str(), &dirEntries, selectDirent, alphasort);
- if (entry_no < 0) {
- @@ -559,9 +559,9 @@
- chdir(rpmsdir.c_str());
-
- if (pkgListSuffix != NULL)
- - pkglist_path = pkglist_path + "/base/pkglist." + pkgListSuffix;
- + pkglist_path = pkglist_path + "/00INDEX.apt-pkglist." + pkgListSuffix;
- else
- - pkglist_path = pkglist_path + "/base/pkglist." + op_suf;
- + pkglist_path = pkglist_path + "/00INDEX.apt-pkglist." + op_suf;
-
-
- if (pkgListAppend == true && FileExists(pkglist_path)) {
- Index: tools/gensrclist.cc
- --- tools/gensrclist.cc.orig 2003-11-24 17:58:34.000000000 +0100
- +++ tools/gensrclist.cc 2003-11-28 21:06:52.000000000 +0100
- @@ -1,11 +1,11 @@
- /*
- * $Id: gensrclist.cc,v 1.8 2003/01/30 17:18:21 niemeyer Exp $
- */
- -#include <alloca.h>
- #include <ctype.h>
- #include <dirent.h>
- #include <errno.h>
- #include <fcntl.h>
- +#include <rpm/glob.h>
- #include <rpm/rpmlib.h>
- #include <stdlib.h>
- #include <string.h>
- @@ -134,6 +134,89 @@
- }
- #endif
-
- +#ifndef HAVE_SCANDIR
- +// from glibc 1.09.1 mod'd by jmik, ins'd by asm, fix'd by sbi
- +int alphasort(const void * a, const void * b)
- +{
- + return strcmp ((*(struct dirent **) a)->d_name,
- + (*(struct dirent **) b)->d_name);
- +}
- +
- +int scandir(const char * dir, struct dirent *** namelist,
- + int (* select)(const struct dirent *),
- + int (* cmp)(const void *, const void *))
- +
- +{
- + DIR *dp = opendir (dir);
- + struct dirent **v = NULL;
- + size_t vsize = 0, i;
- + struct dirent *d;
- + int save;
- +
- + if (dp == NULL)
- + return -1;
- +
- + save = errno;
- + errno = 0;
- +
- + i = 0;
- + while ((d = readdir (dp)) != NULL)
- + {
- + if (select == NULL || (*select) (d))
- + {
- + if (i == vsize)
- + {
- + struct dirent **newv;
- + if (vsize == 0)
- + vsize = 10;
- + else
- + vsize *= 2;
- + newv = (struct dirent **) realloc (v, vsize * sizeof (*v));
- + if (newv == NULL)
- + {
- + lose:
- + errno = ENOMEM;
- + break;
- + }
- + v = newv;
- + }
- +
- + v[i] = (struct dirent *) malloc (d->d_reclen);
- + if (v[i] == NULL)
- + goto lose;
- +
- + // *v[i++] = *d;
- + memcpy(v[i], d, d->d_reclen);
- + i++;
- + }
- + }
- +
- + v[i] = NULL;
- +
- + if (errno != 0)
- + {
- + save = errno;
- + (void) closedir (dp);
- + while (i > 0)
- + free (v[--i]);
- + free (v);
- + errno = save;
- + return -1;
- + }
- +
- + (void) closedir (dp);
- + errno = save;
- +
- + /* Sort the list if we have a comparison function to sort with. */
- + if (cmp != NULL)
- + qsort (v, i, sizeof (struct dirent *), cmp);
- +
- + *namelist = v;
- + return i;
- +}
- +// end of new stuff from glibc
- +#endif
- +
- int main(int argc, char ** argv)
- {
- char buf[300];
- @@ -199,10 +282,10 @@
- } else
- strcpy(buf, arg_dir);
-
- - strcat(buf, "/SRPMS.");
- + strcat(buf, "/");
- strcat(buf, arg_suffix);
-
- - srpmdir = "SRPMS." + string(arg_suffix);
- + srpmdir = string(arg_suffix);
- #ifdef OLD_FLATSCHEME
- if (flatStructure) {
- // add the last component of the directory to srpmdir
- @@ -234,9 +317,9 @@
- chdir(buf);
-
- if (srcListSuffix != NULL)
- - sprintf(buf, "%s/srclist.%s", cwd, srcListSuffix);
- + sprintf(buf, "00INDEX.apt-srclist.%s", srcListSuffix);
- else
- - sprintf(buf, "%s/srclist.%s", cwd, arg_suffix);
- + sprintf(buf, "00INDEX.apt-srclist.%s", arg_suffix);
-
- if (srcListAppend == true && FileExists(buf)) {
- outfd = fdOpen(buf, O_WRONLY|O_APPEND, 0644);
|