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

Re: deity-digest Digest V101 #120

On Fri, Sep 28, 2001 at 12:33:25AM +0100, Carlos Sousa wrote:
> >APT::Get
> >{
> >	Pre-Update "/usr/bin/pon";
> >	Post-Update "/usr/bin/poff";
> >	Pre-Download "/usr/bin/pon";
> >	Post-Download "/usr/bin/poff";
> >}
> >There is a little bug however: if apt doesn't need to download, since all
> >packages are in it's cache, the Pre-Download and Post-Download commands are
> >still executed.
> I can see another "feature": if you are already connected to the 
> Internet (browsing, etc...) you have to remember NOT running 'apt-get 
> update' until you're done, 'coz it'll bring the connection down 
> afterwards.
True, but it is up to the user to modify the apt.conf (the default apt.conf
should NOT use {Pre,Post}-{Update,Download}!). So, if the user wants to manually
connect and disconnect, he shouldn't change anything. If he wants to
automatically connect and manually disconnect, he should only enter the
Pre-{Update,Download} lines.

And of course you can do a lot more than just pon/poff; you can execute any
command. Eg: I have a few workstations, and I want each one to have the same
sources.list, but I want to manually update and upgrade them (I regularly add a
source, and I want all workstations to have access to the same packages).
Therefore, I want the machines to automatically download the latest
sources.list from my server just before 'apt-get update' (or an update from
dselect) is performed, and thus I've added the next line to the apt.conf of
every machine:
  APT::Get::Pre-Update "/usr/local/sbin/getsources.list ftp://debian/debian || true";
(This is actually the reason why I created the patch.)

It's really up to the user to decide what to do with the
{Pre,Post}-{Update,Download} configuration-options.


Reply to: