On Wed, Aug 19, 2009 at 01:57:46PM -0400, Daniel Richard G. wrote: > Okay, here is a revised patch implementing the feature. This time, > apt-cacher-cleanup.pl and the checksum database are onboard. I also > tweaked the long-filename convention to use "::" right before the actual > package name, to make the names easier to parse in Perl. (Colons can > also appear in the filename as part of a host:port combination, so this > kills any ambiguity.) > > The caveat, however, is that I no longer believe mixing long- and short- > filename package files is workable. It's simple if all you're worried > about is the filename lookup in handle_connection(), but it gets very > awkward at the point of doing cache cleanup and checksum validation. And > you can't punt on these, because then the two-step lookup means that a > short-named package file is never superceded by a newer one from the > repository.
I can see that > So I think a new upgrade/import script will be needed. The general > procedure I'm thinking of is along these lines: > > 1. Read in all the package index files, like apt-cacher-cleanup.pl > already does. > > 2. From the big %valid hash, build up an MD5-sum-to-long-filename lookup > hash. (The mapping might be one-to-many, in case we have the exact > same package in multiple distros, so structure the hash accordingly.) > > 3. For each *.deb/*.udeb/*.diff.gz/etc. file, get the MD5 sum, and check > to see if there is a corresponding long filename(s). > 4. If yes, then rename/copy/etc. the package file to the long > filename(s). (If more than one, use hardlinks to conserve inodes.) > > 5. If no, complain that the package can't be imported. > > Does this sound reasonable? #5 would be a new behavior for the import > script, but these would be files that apt-cacher-cleanup.pl would blow > away anyway. I think i would leave them to be cleaned normally > P.S.: The patch includes a few "bonus" fixes that I stumbled upon. Most > of them are self-explanatory; the change to read_config() allows > the user= and group= directives in the config file to be commented > out (as the comments in that file imply that this is supported). Good catches. Thanks. It is amazing what you don't see in code you spend ages looking at! Have you tried running it with checksumming enabled? How is the database coping? Mark -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org