#714877 apt: Please support an apt-get update for a single repository only

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Date:
2015-03-21 03:48:04 UTC
Severity:
wishlist
#714877#5
Date:
2013-07-03 18:36:06 UTC
From:
To:
Hi maintainers,

It would be useful to have the ability to apt-get update a single
repository, without touching the state of other repositories or
downloading their package lists. Updating a single sources.list.d file
would also suffice, and might be easier in terms of syntax.


The primary use case for this would be sbuild: currently, the apt resolver
needs to create a new repository inside the chroot and make apt aware of
it, but if sbuild is run without --apt-update, running `apt-get update`
(which updates every repository) would be inappropriate. So it resorts to
doing some black magic to write out the appropriate /var/lib/apt/lists/
file without actually invoking apt:

http://sources.debian.net/src/sbuild/0.64.0-1/lib/Sbuild/ResolverBase.pm#L179

Being able to run `apt-get update sbuild-build-depends-archive.list` or
something would be much cleaner.

The reason I care about this is that I'm hoping to extend sbuild to allow
adding a new repository at the sbuild command line to provide build
dependencies for the current build only (see bug #700522). I'd rather not
add code to do _more_ of the black magic, and would prefer that apt had a
documented interface to take a new sources.list.d file into account
without updating everything else.

There's also a use case for "normal" end users with lots of repositories,
where a full `apt-get update` takes a while, and they're only looking for
a package in a specific repository.

I tried writing a patch for this, but the most obvious approach ended up
with apt thinking that one sources.list.d file was the _only_ one
configured (and forgetting all other repositories). Patch is attached
because why not; I haven't had time to look into making it work properly,
yet, but might end up doing so eventually.

#714877#12
Date:
2013-07-03 22:20:56 UTC
From:
To:
Hi Geoffrey,
 about the feature itself - running a bit short on time currently)


Your problem is the cleanup of "unused" files and the solution should be:
-o APT::List-Cleanup=0

In sofar you can implement the requested feature without changing apt code:
-o APT::List-Cleanup=0
-o Dir::Etc::sourcelist="/dev/null"
-o Dir::Etc::sourceparts="/directory/with/just/a/few/sources.list.d/files/";
(or the other way around with just one file; I remember writing a patch for
 behaving nicely if a directory is /dev/null – not sure what version this is
 in though currently, but wheezy should have it at least)

Feel free to use this for sbuild as it will work in any APT version.


Best regards

David Kalnischkies

#714877#17
Date:
2013-07-04 01:25:22 UTC
From:
To:
Oh man, this is fantastic! Updating just a local apt repository (made with
dpkg-scanpackages) takes a fraction of a second. I'll use this for my
sbuild branch, and send in a patch to use this for sbuild's current
implementation.

I'd still like an actual feature for this, so that the syntax is more
obvious, but I guess sbuild is running this inside the chroot and won't be
able to rely on it. If you'd prefer not to add this as a feature, I'd be
perfectly happy with documentation to this effect.

Thanks for the tip!