On Fri, Aug 14, 2009 at 06:53:41PM -0400, Daniel Richard G. wrote: > Package: apt-cacher > Version: 1.6.8 > Severity: wishlist > Tags: patch > > Currently, a single instance of apt-cacher cannot serve both Debian and > Ubuntu systems, even though it could serve either one alone. The reason > for this is that there are numerous package files that have the exact > same filename in both distributions, and the way apt-cacher works now, > these package files will collide in the cache. This leads to the > situation where e.g. downloading zip_2.32-1_amd64.deb on a Debian system > may actually give you the package file built for Ubuntu, which will (at > the very least) cause apt-get(8) to squawk about mismatched checksums. > > (Incidentally, I just did a check between the latest Debian and Ubuntu > package indices on AMD64. There appear to be at least 1004 packages with > the same value for Filename: across both distributions.) > > Now, addressing this is not terribly complicated. If you look in > /usr/share/apt-cacher/apt-cacher , starting at line 530, you can see > what's going on. Files like "Packages" can collide way too easily, so > instead of storing them in the cache as just "Packages" or whatnot, you > store then as "$host$uri" with the slashes converted to underscores--- > something like > > debian.mirror.com_debian_dists_lenny_main_binary-amd64_Packages > > But this isn't done for package files---those are just stored with their > names as-is. So, we change that! > > Ah, but a couple caveats. First, there are a lot of existing apt-cacher > caches out there, and if we unilaterally change the names under which > package files are stored, then apt-cacher will no longer have access to > the old-named packages already in its cache, causing it to re-download > everything and thereby annoy people all around. Secondly, if the user > imports packages into the cache (using apt-cacher-import.pl), we might > not be able to figure out what path prefix each package file should > have. Maybe we can do something with index files already in the cache, a > bit like apt-cacher-cleanup.pl does, but that's *messy* and not entirely > straightforward. (I know *I'd* rather not deal with that.)
Thanks for this. Interesting. When I originally went through sorting out the 2 server workaround for this, I considered (and rejected :)) this approach. The problem with it is that apt-cacher was designed to ignore the server path so that .debs from different servers were deemed identical. This is useful for people who use the path_map hopping to provide server redundancy. This approach will break that. I am happy to consider it again, but you need to convince me that it is better than the multiple instance way of doing it. Mark -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org