apt.patch 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. Index: apt-pkg/deb/debsystem.cc
  2. --- apt-pkg/deb/debsystem.cc.orig 2003-11-24 17:58:46.000000000 +0100
  3. +++ apt-pkg/deb/debsystem.cc 2003-11-29 22:44:33.000000000 +0100
  4. @@ -162,7 +162,7 @@
  5. be the only users of these */
  6. Cnf.CndSet("Dir::State::userstatus","status.user"); // Defunct
  7. Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status");
  8. - Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg");
  9. + Cnf.CndSet("Dir::Bin::dpkg","@l_prefix@/bin/dpkg");
  10. return true;
  11. }
  12. @@ -187,7 +187,7 @@
  13. signed Score = 0;
  14. if (FileExists(Cnf.FindFile("Dir::State::status","/var/lib/dpkg/status")) == true)
  15. Score += 10;
  16. - if (FileExists(Cnf.FindFile("Dir::Bin::dpkg","/usr/bin/dpkg")) == true)
  17. + if (FileExists(Cnf.FindFile("Dir::Bin::dpkg","@l_prefix@/bin/dpkg")) == true)
  18. Score += 10;
  19. if (FileExists("/etc/debian_version") == true)
  20. Score += 10;
  21. Index: apt-pkg/init.cc
  22. --- apt-pkg/init.cc.orig 2003-11-24 17:58:44.000000000 +0100
  23. +++ apt-pkg/init.cc 2003-11-29 22:44:33.000000000 +0100
  24. @@ -45,10 +45,10 @@
  25. Cnf.Set("APT::Architecture",COMMON_OS "-" COMMON_CPU);
  26. // CNC:2002-09-10
  27. //Cnf.Set("APT::Build-Essential::", "build-essential");
  28. - Cnf.Set("Dir","/");
  29. + Cnf.Set("Dir","@l_prefix@");
  30. // State
  31. - Cnf.Set("Dir::State","var/lib/apt/");
  32. + Cnf.Set("Dir::State","var/apt/lib/");
  33. /* Just in case something goes horribly wrong, we can fall back to the
  34. old /var/state paths.. */
  35. @@ -61,7 +61,7 @@
  36. Cnf.Set("Dir::State::cdroms","cdroms.list");
  37. // Cache
  38. - Cnf.Set("Dir::Cache","var/cache/apt/");
  39. + Cnf.Set("Dir::Cache","var/apt/cache/");
  40. Cnf.Set("Dir::Cache::archives","archives/");
  41. Cnf.Set("Dir::Cache::srcpkgcache","srcpkgcache.bin");
  42. Cnf.Set("Dir::Cache::pkgcache","pkgcache.bin");
  43. @@ -76,7 +76,7 @@
  44. Cnf.Set("Dir::Etc::main","apt.conf");
  45. Cnf.Set("Dir::Etc::parts","apt.conf.d");
  46. Cnf.Set("Dir::Etc::preferences","preferences");
  47. - Cnf.Set("Dir::Bin::methods",LIBDIR "/apt/methods");
  48. + Cnf.Set("Dir::Bin::methods","@l_prefix@/lib/apt/methods");
  49. Cnf.Set("Acquire::ComprExtension", ".bz2");
  50. bool Res = true;
  51. Index: apt-pkg/luaiface.cc
  52. --- apt-pkg/luaiface.cc.orig 2003-11-24 17:58:50.000000000 +0100
  53. +++ apt-pkg/luaiface.cc 2003-11-29 22:44:33.000000000 +0100
  54. @@ -61,7 +61,7 @@
  55. Lua::Lua()
  56. : DepCache(0), Cache(0), CacheControl(0), Fix(0), DontFix(0)
  57. {
  58. - _config->CndSet("Dir::Bin::scripts", "/usr/lib/apt/scripts");
  59. + _config->CndSet("Dir::Bin::scripts", "@l_prefix@/lib/apt/scripts");
  60. const luaL_reg lualibs[] = {
  61. {"base", luaopen_base},
  62. Index: apt-pkg/rpm/rpmhandler.h
  63. --- apt-pkg/rpm/rpmhandler.h.orig 2003-11-24 17:58:54.000000000 +0100
  64. +++ apt-pkg/rpm/rpmhandler.h 2003-11-29 22:44:33.000000000 +0100
  65. @@ -12,6 +12,7 @@
  66. #include <apt-pkg/fileutl.h>
  67. +#include <rpm/glob.h>
  68. #include <rpm/rpmlib.h>
  69. #include <rpm/rpmmacro.h>
  70. Index: apt-pkg/rpm/rpmpackagedata.cc
  71. --- apt-pkg/rpm/rpmpackagedata.cc.orig 2003-11-24 17:58:55.000000000 +0100
  72. +++ apt-pkg/rpm/rpmpackagedata.cc 2003-11-29 22:44:33.000000000 +0100
  73. @@ -12,6 +12,7 @@
  74. #include <apti18n.h>
  75. +#include <rpm/glob.h>
  76. #include <rpm/rpmlib.h>
  77. RPMPackageData::RPMPackageData()
  78. Index: apt-pkg/rpm/rpmpm.cc
  79. --- apt-pkg/rpm/rpmpm.cc.orig 2003-11-24 17:58:53.000000000 +0100
  80. +++ apt-pkg/rpm/rpmpm.cc 2003-11-29 22:44:33.000000000 +0100
  81. @@ -34,6 +34,7 @@
  82. #include <stdio.h>
  83. #include <iostream>
  84. +#include <rpm/glob.h>
  85. #ifdef HAVE_RPM41
  86. #include <rpm/rpmdb.h>
  87. #define packagesTotal rpmcliPackagesTotal
  88. Index: apt-pkg/rpm/rpmpm.h
  89. --- apt-pkg/rpm/rpmpm.h.orig 2003-11-24 17:58:54.000000000 +0100
  90. +++ apt-pkg/rpm/rpmpm.h 2003-11-29 22:44:33.000000000 +0100
  91. @@ -11,6 +11,7 @@
  92. #ifndef PKGLIB_rpmPM_H
  93. #define PKGLIB_rpmPM_H
  94. +#include <rpm/glob.h>
  95. #include <rpm/rpmlib.h>
  96. #ifdef HAVE_RPM41
  97. #include <rpm/rpmts.h>
  98. Index: apt-pkg/rpm/rpmrecords.h
  99. --- apt-pkg/rpm/rpmrecords.h.orig 2003-11-24 17:58:57.000000000 +0100
  100. +++ apt-pkg/rpm/rpmrecords.h 2003-11-29 22:44:33.000000000 +0100
  101. @@ -21,6 +21,7 @@
  102. #include <apt-pkg/pkgrecords.h>
  103. #include <apt-pkg/fileutl.h>
  104. +#include <rpm/glob.h>
  105. #include <rpm/rpmlib.h>
  106. Index: apt-pkg/rpm/rpmsrcrecords.h
  107. --- apt-pkg/rpm/rpmsrcrecords.h.orig 2003-11-24 17:58:58.000000000 +0100
  108. +++ apt-pkg/rpm/rpmsrcrecords.h 2003-11-29 22:44:33.000000000 +0100
  109. @@ -17,6 +17,7 @@
  110. #include <apt-pkg/srcrecords.h>
  111. #include <apt-pkg/fileutl.h>
  112. +#include <rpm/glob.h>
  113. #include <rpm/rpmlib.h>
  114. Index: apt-pkg/rpm/rpmsystem.cc
  115. --- apt-pkg/rpm/rpmsystem.cc.orig 2003-11-24 17:58:54.000000000 +0100
  116. +++ apt-pkg/rpm/rpmsystem.cc 2003-11-29 22:47:42.000000000 +0100
  117. @@ -123,13 +123,13 @@
  118. /* These are the rpm specific configuration variables.. */
  119. bool rpmSystem::Initialize(Configuration &Cnf)
  120. {
  121. - Cnf.CndSet("Dir::Bin::rpm","/bin/rpm");
  122. + Cnf.CndSet("Dir::Bin::rpm","@l_prefix@/bin/rpm");
  123. Cnf.CndSet("Dir::Etc::rpmpriorities", "rpmpriorities");
  124. Cnf.CndSet("Dir::Etc::translatelist", "translate.list");
  125. Cnf.CndSet("Dir::Etc::translateparts", "translate.list.d");
  126. Cnf.CndSet("Dir::State::prefetch", "prefetch");
  127. - Cnf.CndSet("Dir::Locale","/usr/share/locale");
  128. - Cnf.CndSet("Acquire::DistroID","Conectiva"); // hee hee
  129. + Cnf.CndSet("Dir::Locale","@l_prefix@/share/locale");
  130. + Cnf.CndSet("Acquire::DistroID","OpenPKG");
  131. Cnf.CndSet("Acquire::CDROM::Mount", "/mnt/cdrom");
  132. Cnf.CndSet("Acquire::CDROM::Copy-All", "true");
  133. @@ -200,7 +200,7 @@
  134. if (FileExists(RPMDBHandler::DataPath(false)))
  135. Score += 10;
  136. - if (FileExists(Cnf.FindFile("Dir::Bin::rpm","/bin/rpm")) == true)
  137. + if (FileExists(Cnf.FindFile("Dir::Bin::rpm","@l_prefix@/bin/rpm")) == true)
  138. Score += 10;
  139. return Score;
  140. Index: apt-pkg/rpm/rpmversion.cc
  141. --- apt-pkg/rpm/rpmversion.cc.orig 2003-11-24 17:58:55.000000000 +0100
  142. +++ apt-pkg/rpm/rpmversion.cc 2003-11-29 22:44:33.000000000 +0100
  143. @@ -22,6 +22,7 @@
  144. #include <apt-pkg/rpmversion.h>
  145. #include <apt-pkg/pkgcache.h>
  146. +#include <rpm/glob.h>
  147. #include <rpm/rpmlib.h>
  148. #include <rpm/misc.h>
  149. Index: apt-pkg/sourcelist.cc
  150. --- apt-pkg/sourcelist.cc.orig 2003-11-24 17:58:39.000000000 +0100
  151. +++ apt-pkg/sourcelist.cc 2003-11-29 22:44:33.000000000 +0100
  152. @@ -105,7 +105,7 @@
  153. // Check for an absolute dists specification.
  154. if (Dist.empty() == false && Dist[Dist.size() - 1] == '/')
  155. {
  156. - if (ParseQuoteWord(Buffer,Section) == true)
  157. + if (ParseQuoteWord(Buffer,Section) == false)
  158. return _error->Error(_("Malformed line %lu in source list %s (Absolute dist)"),CurLine,File.c_str());
  159. Dist = SubstVar(Dist,"$(ARCH)",_config->Find("APT::Architecture"));
  160. return CreateItem(List,URI,Dist,Section,Vendor);
  161. Index: cmdline/apt-shell.cc
  162. --- cmdline/apt-shell.cc.orig 2003-11-24 18:00:20.000000000 +0100
  163. +++ cmdline/apt-shell.cc 2003-11-29 22:46:42.000000000 +0100
  164. @@ -3672,7 +3672,7 @@
  165. " remove - Remove packages\n"
  166. " keep - Keep packages\n"
  167. " upgrade - Perform a global upgrade\n"
  168. - " dist-upgrade - Perform a globla distribution upgrade\n"
  169. + " dist-upgrade - Perform a global distribution upgrade\n"
  170. " build-dep - Install build-dependencies for source packages\n"
  171. // " dselect-upgrade - Follow dselect selections\n"
  172. " update - Retrieve new lists of packages\n"
  173. @@ -3694,8 +3694,7 @@
  174. " autoclean - Erase old downloaded archive files\n"
  175. "\n"
  176. "For more information type \"help <cmd>\" or \"<cmd> [-h|--help]\".\n"
  177. - "\n"
  178. - " This APT has Super Cow Powers.\n");
  179. + );
  180. return true;
  181. }
  182. Index: configure.in
  183. --- configure.in.orig 2003-11-24 17:58:30.000000000 +0100
  184. +++ configure.in 2003-11-29 22:44:33.000000000 +0100
  185. @@ -48,14 +48,14 @@
  186. AC_CHECK_HEADER(rpm/rpmlib.h,
  187. [
  188. AC_CHECK_LIB(rpmdb,rpmdbOpen,
  189. - [RPMDBLIBS="-lrpmdb"],
  190. + [RPMDBLIBS="@l_rpmlibs_base@"],
  191. [RPMDBLIBS="-ldb-3.1"],
  192. - [-lrpm -lrpmio -lz -lbz2 -lpopt])
  193. + [@l_rpmlibs_base@ @l_rpmlibs_extra@])
  194. AC_CHECK_LIB(rpm,rpmdbGetIteratorOffset,
  195. [AC_DEFINE_UNQUOTED(HAVE_RPM, 1)
  196. AC_DEFINE_UNQUOTED(HAVE_RPM4, 1)
  197. - RPMLIBS="-lrpm $RPMDBLIBS -lrpmio -lz -lbz2 -lpopt"
  198. + RPMLIBS="@l_rpmlibs_base@ $RPMDBLIBS @l_rpmlibs_extra@"
  199. AC_CHECK_LIB(rpm, rpmtsUpdateDSI,
  200. [AC_DEFINE_UNQUOTED(HAVE_RPM41, 1)
  201. rpm_version="4.1"],
  202. @@ -64,11 +64,11 @@
  203. ],
  204. [AC_CHECK_LIB(rpm,rpmdbFirstRecNum,
  205. [AC_DEFINE_UNQUOTED(HAVE_RPM, 1)
  206. - RPMLIBS="-lrpm -ldb1 -lz -lbz2 -lpopt"
  207. + RPMLIBS="@l_rpmlibs_base@"
  208. rpm_version="3"],,
  209. - [-ldb1 -lz -lbz2 -lpopt])
  210. + [@l_rpmlibs_base@])
  211. ],
  212. - [$RPMDBLIBS -lrpmio -lz -lbz2 -lpopt])
  213. + [$RPMDBLIBS @l_rpmlibs_base@ @l_rpmlibs_extra@])
  214. AC_SUBST(RPMLIBS)
  215. ])
  216. Index: methods/gpg.cc
  217. --- methods/gpg.cc.orig 2003-11-24 17:59:24.000000000 +0100
  218. +++ methods/gpg.cc 2003-11-29 22:44:33.000000000 +0100
  219. @@ -10,6 +10,11 @@
  220. #include <stdio.h>
  221. #include <sys/wait.h>
  222. +#ifdef OPENPKG_SOLARIS
  223. +#include <sys/syscall.h>
  224. +#include <sys/systm.h>
  225. +#endif
  226. +
  227. #include <apti18n.h>
  228. class GPGMethod : public pkgAcqMethod
  229. @@ -173,7 +178,81 @@
  230. }
  231. #undef STRCMP
  232. +#ifdef OPENPKG_SOLARIS
  233. +
  234. +static const char letters[] =
  235. +"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  236. +
  237. +static int gen_tempname (char *tmpl)
  238. +{
  239. + int len;
  240. + char *XXXXXX;
  241. + static uint64_t value;
  242. + uint64_t random_time_bits;
  243. + int count, fd = -1;
  244. + int save_errno = errno;
  245. +
  246. + len = strlen(tmpl);
  247. + if ( len < 6 || strcmp (&tmpl[len - 6], "XXXXXX")) {
  248. + __set_errno(EINVAL);
  249. + return -1;
  250. + }
  251. +
  252. + XXXXXX = &tmpl[len - 6];
  253. + random_time_bits = time(NULL);
  254. + value += random_time_bits ^ getpid();
  255. +
  256. + for ( count = 0; count < TMP_MAX; value += 7777, ++count) {
  257. + uint64_t v = value;
  258. + XXXXXX[0] = letters[v % 62];
  259. + v /= 62;
  260. + XXXXXX[1] = letters[v % 62];
  261. + v /= 62;
  262. + XXXXXX[2] = letters[v % 62];
  263. + v /= 62;
  264. + XXXXXX[3] = letters[v % 62];
  265. + v /= 62;
  266. + XXXXXX[4] = letters[v % 62];
  267. + v /= 62;
  268. + XXXXXX[5] = letters[v % 62];
  269. +
  270. + fd = mkdir(tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
  271. +
  272. + if ( fd > 0 ) {
  273. + __set_errno(save_errno);
  274. + return fd;
  275. + }
  276. + else if ( errno != EEXIST ) {
  277. + return -1;
  278. + }
  279. +
  280. + }
  281. +
  282. + __set_errno(EEXIST);
  283. + return -1;
  284. +}
  285. +
  286. +static char *mkdtemp(char *templat)
  287. +{
  288. + if (gen_tempname (templat))
  289. + return NULL;
  290. + else
  291. + return templat;
  292. +}
  293. +
  294. +static void unsetenv(char *varname)
  295. +{
  296. + char *tempstr = (char *)malloc(strlen(varname) + 2);
  297. + if ( tempstr == (char *)NULL ) {
  298. + return;
  299. + }
  300. + sprintf(tempstr, "%s=", varname);
  301. + tempstr[strlen(varname) + 1] = '\0';
  302. + putenv(tempstr);
  303. + free(tempstr);
  304. +}
  305. +#endif /* OPENPKG_SOLARIS */
  306. char *getFileSigner(const char *file, const char *sigfile,
  307. const char *outfile, string &signerKeyID)
  308. Index: methods/http.cc
  309. --- methods/http.cc.orig 2003-11-24 17:59:25.000000000 +0100
  310. +++ methods/http.cc 2003-11-29 22:52:44.000000000 +0100
  311. @@ -680,7 +680,7 @@
  312. // CNC:2003-01-29
  313. string UserAgent = _config->Find("Acquire::http::User-Agent");
  314. if (UserAgent.empty() == true)
  315. - UserAgent = "RPM APT-HTTP/1.3";
  316. + UserAgent = "OpenPKG RPM APT-HTTP/1.3";
  317. Req += string("User-Agent: ") + UserAgent + "\r\n\r\n";
  318. if (Debug == true)
  319. Index: test/scratch.cc
  320. --- test/scratch.cc.orig 2003-11-24 17:57:07.000000000 +0100
  321. +++ test/scratch.cc 2003-11-29 22:44:33.000000000 +0100
  322. @@ -51,7 +51,7 @@
  323. /* Db.GetFLCache().BeginDiverLoad();
  324. pkgFLCache::PkgIterator Pkg(Db.GetFLCache(),0);
  325. - if (Db.GetFLCache().AddDiversion(Pkg,"/usr/include/linux/kerneld.h","/usr/bin/nslookup") == false)
  326. + if (Db.GetFLCache().AddDiversion(Pkg,"/usr/include/linux/kerneld.h","@l_prefix@/bin/nslookup") == false)
  327. cerr << "Error!" << endl;
  328. const char *Tmp = "/usr/include/linux/kerneld.h";
  329. Index: tools/cached_md5.cc
  330. --- tools/cached_md5.cc.orig 2003-11-24 17:58:34.000000000 +0100
  331. +++ tools/cached_md5.cc 2003-11-29 22:44:33.000000000 +0100
  332. @@ -1,11 +1,11 @@
  333. /*
  334. * $Id: cached_md5.cc,v 1.4 2003/01/29 13:47:31 niemeyer Exp $
  335. */
  336. -#include <alloca.h>
  337. #include <ctype.h>
  338. #include <dirent.h>
  339. #include <errno.h>
  340. #include <fcntl.h>
  341. +#include <rpm/glob.h>
  342. #include <rpm/rpmlib.h>
  343. #include <stdlib.h>
  344. #include <string.h>
  345. Index: tools/genbasedir
  346. --- tools/genbasedir.orig 2003-11-24 17:58:35.000000000 +0100
  347. +++ tools/genbasedir 2003-11-29 22:49:11.000000000 +0100
  348. @@ -39,7 +39,7 @@
  349. phashstuff()
  350. {
  351. size=`getsize $1`
  352. - md5=`md5sum $1|cut -f1 -d\ `
  353. + md5=`openssl md5 <$1`
  354. echo " $md5 $size $2"
  355. }
  356. @@ -167,7 +167,7 @@
  357. rm -f $comps; touch $comps
  358. for dir in $topdir/RPMS.* $topdir/SRPMS.* $topdir/../SRPMS.*; do
  359. if [ -d $dir ]; then
  360. - echo $dir | sed 's/.*\.//' >> $comps
  361. + echo $dir | sed 's/.*RPMS\.//' >> $comps
  362. fi
  363. done
  364. components=`cat $comps|sort|uniq`
  365. @@ -222,9 +222,9 @@
  366. fi
  367. if test x$updateinfo = x; then
  368. - (cd $basedir; genpkglist $progress $bloat $meta_opts --index $srcidxdir/srcidx.$comp $topdir $comp)
  369. + (cd $basedir; @l_prefix@/bin/genpkglist $progress $bloat $meta_opts --index $srcidxdir/srcidx.$comp $topdir $comp)
  370. else
  371. - (cd $basedir; genpkglist $progress $bloat $meta_opts --index $srcidxdir/srcidx.$comp --info $updateinfo $topdir $comp)
  372. + (cd $basedir; @l_prefix@/bin/genpkglist $progress $bloat $meta_opts --index $srcidxdir/srcidx.$comp --info $updateinfo $topdir $comp)
  373. fi
  374. if [ -z "$meta" -a -f $basedir/pkglist.$comp ]; then
  375. @@ -314,9 +314,9 @@
  376. fi
  377. if [ $mapi -ne 0 ]; then
  378. - (cd $basedir; gensrclist $progress $flat $meta_opts --mapi $srctopdir $comp $srcidxdir/srcidx.$comp)
  379. + (cd $basedir; @l_prefix@/bin/gensrclist $progress $flat $meta_opts --mapi $srctopdir $comp $srcidxdir/srcidx.$comp)
  380. else
  381. - (cd $basedir; gensrclist $progress $flat $meta_opts $srctopdir $comp $srcidxdir/srcidx)
  382. + (cd $basedir; @l_prefix@/bin/gensrclist $progress $flat $meta_opts $srctopdir $comp $srcidxdir/srcidx)
  383. fi
  384. if [ -z "$meta" -a -f $basedir/srclist.$comp ]; then
  385. @@ -420,14 +420,14 @@
  386. if [ $partial -eq 0 ]; then
  387. echo -n "Updating global release file... "
  388. sed -n -e "/^MD5Sum:/q" \
  389. - -e "s/^Date:.*\$/Date: `date -R`/" \
  390. + -e "s/^Date:.*\$/Date: `date '+%a, %d %b %Y %H:%M:%S %z' | sed -e 's/%z/+0000/'`/" \
  391. -e "s/^Components:.*\$/Components: $components/" \
  392. -e "p" $release.old > $release
  393. echo "MD5Sum:" >> $release
  394. else
  395. echo -n "Partially updating global release file... "
  396. sed -n -e "/^\$/q" \
  397. - -e "s/^Date:.*\$/Date: `date -R`/" \
  398. + -e "s/^Date:.*\$/Date: `date '+%a, %d %b %Y %H:%M:%S %z' | sed -e 's/%z/+0000/'`/" \
  399. -e "p" $release.old > $release.pre
  400. for comp in $components; do
  401. sed -e "\#^ .* $pkglist_.$comp\(.bz2\)\?\$#d" \
  402. @@ -448,7 +448,7 @@
  403. echo "Label: Unknown" >> $release
  404. echo "Suite: Unknown" >> $release
  405. echo "Codename: Unknown" >> $release
  406. - echo "Date: `date -R`" >> $release
  407. + echo "Date: `date '+%a, %d %b %Y %H:%M:%S %z' | sed -e 's/%z/+0000/'`" >> $release
  408. echo "Architectures: Unknown" >> $release
  409. echo "Components: $components" >> $release
  410. echo "Description: Not available" >> $release
  411. @@ -587,6 +587,4 @@
  412. rm -f $basedir/hashfile.gpg.old
  413. fi
  414. -echo "All your base are belong to us!!!"
  415. -
  416. # vim:ts=4:sw=4
  417. Index: tools/genpkglist.cc
  418. --- tools/genpkglist.cc.orig 2003-11-24 17:58:36.000000000 +0100
  419. +++ tools/genpkglist.cc 2003-11-29 22:44:33.000000000 +0100
  420. @@ -1,11 +1,11 @@
  421. /*
  422. * $Id: genpkglist.cc,v 1.7 2003/01/30 17:18:21 niemeyer Exp $
  423. */
  424. -#include <alloca.h>
  425. #include <ctype.h>
  426. #include <dirent.h>
  427. #include <errno.h>
  428. #include <fcntl.h>
  429. +#include <rpm/glob.h>
  430. #include <rpm/rpmlib.h>
  431. #include <stdlib.h>
  432. #include <string.h>
  433. @@ -369,7 +369,7 @@
  434. }
  435. int scandir(const char * dir, struct dirent *** namelist,
  436. - int (* select)(struct dirent *),
  437. + int (* select)(const struct dirent *),
  438. int (* cmp)(const void *, const void *))
  439. {
  440. Index: tools/gensrclist.cc
  441. --- tools/gensrclist.cc.orig 2003-11-24 17:58:34.000000000 +0100
  442. +++ tools/gensrclist.cc 2003-11-29 22:44:33.000000000 +0100
  443. @@ -1,11 +1,11 @@
  444. /*
  445. * $Id: gensrclist.cc,v 1.8 2003/01/30 17:18:21 niemeyer Exp $
  446. */
  447. -#include <alloca.h>
  448. #include <ctype.h>
  449. #include <dirent.h>
  450. #include <errno.h>
  451. #include <fcntl.h>
  452. +#include <rpm/glob.h>
  453. #include <rpm/rpmlib.h>
  454. #include <stdlib.h>
  455. #include <string.h>
  456. @@ -134,6 +134,89 @@
  457. }
  458. #endif
  459. +#ifndef HAVE_SCANDIR
  460. +// from glibc 1.09.1 mod'd by jmik, ins'd by asm, fix'd by sbi
  461. +int alphasort(const void * a, const void * b)
  462. +{
  463. + return strcmp ((*(struct dirent **) a)->d_name,
  464. + (*(struct dirent **) b)->d_name);
  465. +}
  466. +
  467. +int scandir(const char * dir, struct dirent *** namelist,
  468. + int (* select)(const struct dirent *),
  469. + int (* cmp)(const void *, const void *))
  470. +
  471. +{
  472. + DIR *dp = opendir (dir);
  473. + struct dirent **v = NULL;
  474. + size_t vsize = 0, i;
  475. + struct dirent *d;
  476. + int save;
  477. +
  478. + if (dp == NULL)
  479. + return -1;
  480. +
  481. + save = errno;
  482. + errno = 0;
  483. +
  484. + i = 0;
  485. + while ((d = readdir (dp)) != NULL)
  486. + {
  487. + if (select == NULL || (*select) (d))
  488. + {
  489. + if (i == vsize)
  490. + {
  491. + struct dirent **newv;
  492. + if (vsize == 0)
  493. + vsize = 10;
  494. + else
  495. + vsize *= 2;
  496. + newv = (struct dirent **) realloc (v, vsize * sizeof (*v));
  497. + if (newv == NULL)
  498. + {
  499. + lose:
  500. + errno = ENOMEM;
  501. + break;
  502. + }
  503. + v = newv;
  504. + }
  505. +
  506. + v[i] = (struct dirent *) malloc (d->d_reclen);
  507. + if (v[i] == NULL)
  508. + goto lose;
  509. +
  510. + // *v[i++] = *d;
  511. + memcpy(v[i], d, d->d_reclen);
  512. + i++;
  513. + }
  514. + }
  515. +
  516. + v[i] = NULL;
  517. +
  518. + if (errno != 0)
  519. + {
  520. + save = errno;
  521. + (void) closedir (dp);
  522. + while (i > 0)
  523. + free (v[--i]);
  524. + free (v);
  525. + errno = save;
  526. + return -1;
  527. + }
  528. +
  529. + (void) closedir (dp);
  530. + errno = save;
  531. +
  532. + /* Sort the list if we have a comparison function to sort with. */
  533. + if (cmp != NULL)
  534. + qsort (v, i, sizeof (struct dirent *), cmp);
  535. +
  536. + *namelist = v;
  537. + return i;
  538. +}
  539. +// end of new stuff from glibc
  540. +#endif
  541. +
  542. int main(int argc, char ** argv)
  543. {
  544. char buf[300];