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

Bug#698723: lintian: Error on different trigger directives for the same trigger-name



On Tue, 2013-01-22 at 20:38:09 +0100, Niels Thykier wrote:
> On 2013-01-22 19:50, Guillem Jover wrote:
> > Due to 537051 we noticed that the documentation for the triggers
> > control file directives is not really clear. Using the two different
> > directives for the same trigger names is pretty confusing as only the
> > last one will be honoured. Things like this in the .deb triggers
> > control file:
> > 
> > ,--- DEBIAN/triggers
> > | interest-noawait foo
> > | interest foo
> > `---
> > 
> > would only add a non-awaiting trigger to the dpkg database. The same
                  ^an awaiting
> > goes for activate-noawait/activate. Ideally dpkg would contain better
> > documentation explaining this, and the code would make sure this never
> > happens at build time, and warn at unpack time, etc. For further
> > details of the situation that brought up this, read starting at:
> > 
> >   <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=537051#90>

> When you say the "only last one will be honoured" does mean that an
> "interest foo" and "activate foo" can override each other (or is that a
> separate namespace).  I understand that interest is for file names and
> activate is not, but just for getting the case right.

Ah, sorry about the poor description. Both interest and activate
directives can work with explicit triggers and file triggers. I should
have said “using two different variants of the same directive for the
same trigger name”, let me show some examples to try to clarify:

Different directives for different trigger-names are fine and normal.

,--- ok
  activate foo-a
  interest-noawait /path/to/a
  interest /path/to/b
  activate-noawait foo-b
`---

And ah, nice! now that you mention it, different directives (interest
or activate of any variant) for the same trigger-name is suspect, dpkg
will not activate triggers for a package that's interested in itself,
as the trigger will be activated during unpack which ignores those.
This should be a warning, because even if this does not make much sense
semantically, it could be legimitate (?) if other packages might
activate or might be interested in the same trigger-name, perhaps.

,--- hmmm, suspect but could be okish
  activate explicit-name-a
  interest-noawait explicit-name-a
`---

Different variants of the same directive are always problematic. The
following cases should be errors, as relying on undefined behaviour:

,--- not ok
  interest-noawait explicit-name-a
  interest explicit-name-a
  interest /path/to/a
  interest-noawait /path/to/a
`---

,--- not ok
  activate explicit-name-a
  activate-noawait explicit-name-a
  activate-noawait /path/to/a
  activate /path/to/a
`---


Hope this clarifies.

Thanks,
Guillem


Reply to: