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

Bug#478970: Bug#479870: aptitude should update dpkg available information on updates



On Sat, Apr 28, 2012 at 12:51:58PM +0800, Daniel Hartwig wrote:
> The naïve implementation is something like:
> 
> APT::Update::Post-Invoke-Success { "[ ! -x /usr/sbin/sync-available ]
> || /usr/sbin/sync-available"; };
> 
> in apt.conf.d.  However, some interactive package managers (e.g.
> aptitude, synaptic) lock dpkg while those hooks are run and the above
> code would fail.[1]  I find no documentation on the use of
> Post-Invoke-Success, or whether it is safe to assume dpkg (or any
> other db) is unlocked when it is run.  An alternative implementation
> can notify a cron job or spawn a long-running background task to wait
> for the lock being released:
> 
> APT::Update::Post-Invoke-Success {" [ ! -x /usr/sbin/sync-available ]
> || /usr/sbin/sync-available --wait &"; };
> 
> (with new "--wait" option on sync-available).

I'm likely not going to implement this in dctrl-tools.  It's one thing to
provide the user with the means to update the dpkg available file, and it's
quite another for the (non-dpkg) package to decide on its own that the file
should be updated.

However, I do wonder if I should simply make dctrl-tools maintain its own
available file, updated in the manner you suggest, and used by grep-available.

When I originally wrote grep-dctrl, apt existed (but was not commonly used),
aptitude didn't exist (but there were plans for something similar), and dselect
was the dominant tool for package upgrades.  At that time, the available file
was always up to date, and it made sense for grep-dctrl to just use it (of
course, being young and timid, I tried to hedge this use of dpkg's internal
data by making it configurable what file grep-available would read; it was
never a particularly good hedge and wasn't actually used for any good purpose,
so I recently deleted that code).  I'm not sure what sense there is for
dctrl-tools to continue relying on an internal dpkg data file.

-- 
Antti-Juhani Kaijanaho, Jyväskylä, Finland
http://antti-juhani.kaijanaho.fi/newblog/
http://www.flickr.com/photos/antti-juhani/

Attachment: signature.asc
Description: Digital signature


Reply to: