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

Bug#563737: smarter cleaning of /var/lib/apt/lists



also sprach Julian Andres Klode <jak@debian.org> [2010.01.07.0443 +1300]:
> I don't think that this could be done easily as the files are identified
> based on hostname, port and path.

But there are *_Release files, and I think the heuristic could be:

try:
  for each file in …/lists that would be deleted:
    set a=string before '_dists_'
    set b=string after and including '_dists_'
    set c=extracted suite from $b (e.g. 'lenny')

    if $a_dists_$c_Release matches /^Origin: Debian/:
      if there is a matching sources.list entry:
        set d=extracted base URI up to /dists/ from sources.list
        rename s/$a/$d/
      else
        throw
    else
      throw

catch:
  do regular delete.

> Options for you might be:
> a) local apt-cacher-ng serving from localhost:3142/debian/
>    - the real source configured in /etc/apt-cacher-ng/backends_debian

That would not prevent apt-cacher-ng from redownloading or me having
to manually prevent that.

> b) using ftp.debian.org in sources.list and hacking /etc/hosts to make
>    it point to your favorite mirror. Works in most cases.

There are mirrors that have the repo in other paths than /debian/

-- 
 .''`.   martin f. krafft <madduck@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
"i don't think so," said rene descartes. just then, he vanished.

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)


Reply to: