[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Package Pool Proposal



On Mon, 6 Dec 1999, Wim Kerkhoff wrote:

> You could also give apt-move a try.  apt-move is a shell script that will
> move packages out of apt's cache directory into proper mirror format.  You
> can also tell it to mirror an arch (apt-move mirror), download the
> packages that you currently have installed (apt-move sync), create
> package lists, and remove obsolete packages.  [ ... ]

Yeah, I'm doing the same, and it works great, with ONE exception:

There is a bug in dpgk-scanpackages that shows up if you do NOT delete old
versions of a package; i.e. if you have DELETE=no in the apt-move config
file.

Apt-move uses dpkg-scanpackages to generate the Packages file.  However,
when it encounters multiple versions of package 'foo' in your mirror,
dpkg-scanpackages enters just one of the versions into Packages.
Unfortunately, the version chosen is arbitrary.

So if the older version if in Packages, my script:

	apt-get -q -y -d dselect-upgrade
	apt-move -b localupdate

keeps downloading the newer 'foo' night after night ... :(

I have a fix for dpkg-scanpackages that uses the NEWEST version, rather
than an arbitrary one.  In response to my report (Bug#51478) it has been
suggested that another alternative is to put ALL versions of a package
into the Packages file (newest first).


--Steve


--- dpkg-scanpackages   Fri Nov 26 14:24:47 1999
+++ /usr/bin/dpkg-scanpackages  Sun Nov 28 21:37:53 1999
@@ -72,10 +74,19 @@
     $p= $tv{'Package'}; delete $tv{'Package'};
 
     if (defined($p1{$p})) {
+      # compare version strings; replace if we found a newer version of
+      # the package
+      `dpkg --compare-versions $tv{'Version'} gt $pv{$p,'Version'}`;
+      if ( $? ) {
         print(STDERR " ! Package $p (filename $fn) is repeat;\n".
                      "   ignored that one and using data from
$pfilename{$p} !\n")
             || die $!;
         next;
+      } else {
+        print(STDERR " ! Package $p (filename $fn) is repeat;\n".
+                     "   replacing data from $pfilename{$p} !\n")
+            || die $!;
+      }
     }
     print(STDERR " ! Package $p (filename $fn) has Filename field!\n") ||
die $!
         if defined($tv{'Filename'});
 




Reply to: