Re: New method for Packages/Sources file updates
On Thu, 25 Nov 2004, Goswin von Brederlow wrote:
> Updating the Packages file then consists of 3 steps:
> A) download all new entries for the Packages file
> Since the Packages file are sorted by date the client just downloads
> the file until it hits an entry it already has in the existing
> file. At that point the client can stop downloading and prepend it
> to the old file. Note that the client can download the gziped file
> and gunzip it on the fly.
> This already gives a fully functional Packages file but now there
> are some obsolete entries (which doesn't realy harm anyone).
> B) remove entries that have been superseeded by newer versions
> The package names in a Packages file are uniq [excluding
> snapshots.debian.net here]. The client can remove all but the
> highest version of each package to remove most obsolete entries.
> This gives nearly the right Packages file but there are still
> entries left that have been removed completly.
> C) download the list of removed packages (again only until you hit one
> you already have in the old removals file)
> For any new entry in the removals file remove the respective entry
> from the Packages file. (If a package is readded later it will be
> added again in step A and not removed here since it isn't new. The
> package has to be removed from the removals file on the server but
> not neccessarily on the client.)
> Now we should have a Packages file identical with the one on the
> server. If not something went horribly wrong.
Packages files can continue multiple entries for a package. With different
versions. Maybe even with different files(not certain about this latter).
You can't use just the pkgname as the primary key.