On Wed, Apr 04, 2012 at 11:43:48AM +0200, Raphael Hertzog wrote:
> On Wed, 04 Apr 2012, Josh Triplett wrote:
> > > In some way we already do:
> > > $ sudo dpkg-trigger --no-await /usr/local/man
> > > $ sudo dpkg --configure -a
> > > Processing triggers for man-db ...
> > > 
> > > But there's easy way to find out all the file triggers that match
> > > /usr/local/something.
> 
> I meant "there's no easy way".

I guessed that, yeah.

> > running spuriously, triggering *everything* seems acceptable for a first
> > pass.  A quick (untested) prototype version:
> > 
> > find /usr/local -exec dpkg-trigger --no-await '{}' \;
> 
> dpkg-trigger will only accept names of existing triggers. That's why I was
> telling that you would need a way to extract a list of file triggers.

Oh, I see.  I would have expected "dpkg-trigger /path/to/file" to
trigger triggers for "/path/to", not just "/path/to/file".  But it looks
like that doesn't work.

(The find command I suggested should still work, since it'll trigger all
parent paths as well, so unless a package had "interest /usr" or
"interest /", it should work.  But the more optimized version that only
triggers on changed files would not work, without explicitly triggering
all parent directories as well.)

> Then you can easily match file triggers with files installed in
> /usr/local/.

Rather than trying to parse triggers here, why not just add an option to
dpkg-trigger which says to interpret the argument as a filename,
precisely as it would when dpkg wants to install/modify a file with that
name, and trigger any triggers which care about either that name or any
parent directory?

Thus, while dpkg-trigger /path/to/file only triggers a package that has
"interest /path/to/file", dpkg-trigger --filename /path/to/file would
trigger a package with "interest /path/to" as well.

(Preferably, dpkg-trigger should take an arbitrary number of filenames
rather than just one, but that just represents an optimization.)

Having such an option seems preferable to manually extracting lists of
existing file triggers and parsing them.  In particular, it would also
work for any future extensions to file triggers (such as more intricate
include/exclude logic).

- Josh Triplett



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to