Debian Bug report logs - #628564
debhelper: dh_installmenu should no longer add the postinst/postrm snippet for registering menu entries

version graph

Package: debhelper; Maintainer for debhelper is Debhelper Maintainers <debhelper-devel@lists.alioth.debian.org>; Source for debhelper is src:debhelper.

Reported by: Raphaël Hertzog <hertzog@debian.org>

Date: Mon, 30 May 2011 09:00:03 UTC

Severity: normal

Found in version debhelper/8.1.6

Fix blocked by 628574: menu should not ignore menu entries for packages that were configured once

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, menu@packages.debian.org, Joey Hess <joeyh@debian.org>:
Bug#628564; Package debhelper. (Mon, 30 May 2011 09:00:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphaël Hertzog <hertzog@debian.org>:
New Bug report received and forwarded. Copy sent to menu@packages.debian.org, Joey Hess <joeyh@debian.org>. (Mon, 30 May 2011 09:00:09 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Raphaël Hertzog <hertzog@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: debhelper: dh_installmenu should no longer add the postinst/postrm snippet for registering menu entries
Date: Mon, 30 May 2011 10:51:34 +0200
Package: debhelper
Version: 8.1.6
Severity: normal

I noticed that a simple package install triggers the menu trigger twice:
----
Preparing to replace zim 0.52-1 (using .../archives/zim_0.52-1_all.deb) ...
Unpacking replacement zim ...
Processing triggers for shared-mime-info ...
Processing triggers for menu ...
Processing triggers for desktop-file-utils ...
Processing triggers for man-db ...
Processing triggers for hicolor-icon-theme ...
Processing triggers for python-support ...
Processing triggers for gnome-menus ...
Setting up zim (0.52-1) ...
Processing triggers for python-support ...
Processing triggers for menu ...
----

The first one is because of the file trigger that dpkg activates. The second
one is because update-menus is called in the postinst. And update-menus runs
"dpkg-trigger --by-package=menu /usr/share/menu" if it sees that the dpkg lock
is active.

This is obviously counter-productive.

I thus believe that debhelper should no longer add the snippets for simple menu
files. Even oldstable has a menu with triggers support, thus I believe you
don't even have to care with backwards compatibility and/or partial upgrades.

Cheers,

PS: X-Debbugs-CC to menu@packages.debian.org set.

-- System Information:
Debian Release: wheezy/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'proposed-updates'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (150, 'experimental')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.38-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages debhelper depends on:
ii  binutils              2.21.51.20110523-1 The GNU assembler, linker and bina
ii  dpkg-dev              1.16.1             Debian package development tools
ii  file                  5.04-5+b1          Determines file type using "magic"
ii  html2text             1.3.2a-15          advanced HTML to text converter
ii  man-db                2.6.0.2-1          on-line manual pager
ii  perl                  5.12.3-7           Larry Wall's Practical Extraction 
ii  perl-base             5.12.3-7           minimal Perl system
ii  po-debconf            1.0.16+nmu1        tool for managing templates file t

debhelper recommends no packages.

Versions of packages debhelper suggests:
ii  dh-make                       0.58       tool that converts source archives

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#628564; Package debhelper. (Mon, 30 May 2011 09:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Mon, 30 May 2011 09:30:11 GMT) Full text and rfc822 format available.

Message #10 received at 628564@bugs.debian.org (full text, mbox):

From: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
To: Raphaël Hertzog <hertzog@debian.org>, 628564@bugs.debian.org
Subject: Re: Bug#628564: debhelper: dh_installmenu should no longer add the postinst/postrm snippet for registering menu entries
Date: Mon, 30 May 2011 11:27:44 +0200
On Mon, May 30, 2011 at 10:51:34AM +0200, Raphaël Hertzog wrote:
> Package: debhelper
> Version: 8.1.6
> Severity: normal
> 
> I noticed that a simple package install triggers the menu trigger twice:
> ----
> Preparing to replace zim 0.52-1 (using .../archives/zim_0.52-1_all.deb) ...
> Unpacking replacement zim ...
> Processing triggers for shared-mime-info ...
> Processing triggers for menu ...
> Processing triggers for desktop-file-utils ...
> Processing triggers for man-db ...
> Processing triggers for hicolor-icon-theme ...
> Processing triggers for python-support ...
> Processing triggers for gnome-menus ...
> Setting up zim (0.52-1) ...
> Processing triggers for python-support ...
> Processing triggers for menu ...
> ----
> 
> The first one is because of the file trigger that dpkg activates. The second
> one is because update-menus is called in the postinst. And update-menus runs
> "dpkg-trigger --by-package=menu /usr/share/menu" if it sees that the dpkg lock
> is active.

Hello Raphaël,

This is an old, known, issue, see bug #518919.  Menu must be triggered after
the package is configured, not before. 

Currently the only way to achieve that is to add a call to dpkg-trigger in the
package postint.  This is the purpose of the debhelper snippet.

See wishlist bug #556104 against dpkg.

Cheers,
-- 
Bill. <ballombe@debian.org>

Imagine a large red swirl here. 




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#628564; Package debhelper. (Mon, 30 May 2011 10:54:22 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Mon, 30 May 2011 10:54:27 GMT) Full text and rfc822 format available.

Message #15 received at 628564@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
Cc: 628564@bugs.debian.org
Subject: Re: Bug#628564: debhelper: dh_installmenu should no longer add the postinst/postrm snippet for registering menu entries
Date: Mon, 30 May 2011 12:52:47 +0200
[Message part 1 (text/plain, inline)]
clone 628564 -1
reassign -1
retitle -1 menu should not ignore menu entries for packages that were configured once
tag -1 + patch
thanks

On Mon, 30 May 2011, Bill Allombert wrote:
> This is an old, known, issue, see bug #518919.  Menu must be triggered after
> the package is configured, not before. 
> 
> Currently the only way to achieve that is to add a call to dpkg-trigger in the
> package postint.  This is the purpose of the debhelper snippet.

Then you should drop the file trigger in the first place and use a named
trigger. It's ridiculous to run it twice, once to drop the menu entry and
once to add it back. In particular when most upgraded applications work
just fine while being unpacked.

But I really think it's a bug of menu... I share completely the remarks
of Joey in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518919#15

In particular, the dpkg states precisely mean "your package is not
configured, it might not work" and if menu entries do not work when a
package is not in installed state, it's sort of to be expected.
When your system is not clean, your priority is to bring it back to a
clean state and hiding the fact that it's not clean is counter-productive.

But if you really want to keep doing something like this, then as an
intermediary solution I suggest you do not ignore packages which are not
configured but that were already configured once. You can detect those
packages since they have a non-empty "Config-Version" field.

And the postinst snippet would then only record the trigger for the
initial installation of the package. And the postrm snippet would no
longer be needed either.

Tentative untested patch for update-menus attached. I tested the sed
invocation this way:
$ echo -e "install ok unpacked  foo 0.1\ninstall ok installed baz, baz2 bar \ninstall ok unpacked foo2 "| sed -e "/^.* installed / b select; /[^ ]$/ b select; d; :select {s/^[^ ]* [^ ]* [^ ]* //; s/ [^ ]*\$//; s/[, ][, ]*/\n/g; p; d};"

foo
baz
baz2
bar
$ 

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)
[patch (text/plain, attachment)]

Bug 628564 cloned as bug 628574. Request was from Raphael Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Mon, 30 May 2011 10:54:30 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#628564; Package debhelper. (Mon, 30 May 2011 15:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. (Mon, 30 May 2011 15:45:03 GMT) Full text and rfc822 format available.

Message #22 received at 628564@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: Raphaël Hertzog <hertzog@debian.org>, 628564@bugs.debian.org
Subject: Re: Bug#628564: debhelper: dh_installmenu should no longer add the postinst/postrm snippet for registering menu entries
Date: Mon, 30 May 2011 11:43:41 -0400
[Message part 1 (text/plain, inline)]
Please see bug #518919. Also see menu's own documentation which
still says update-menus has to be run.

Shall I reassign this bug to dpkg, or menu, or what?

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#628564; Package debhelper. (Mon, 30 May 2011 16:09:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Mon, 30 May 2011 16:09:06 GMT) Full text and rfc822 format available.

Message #27 received at 628564@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Joey Hess <joeyh@debian.org>
Cc: 628564@bugs.debian.org, Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
Subject: Re: Bug#628564: debhelper: dh_installmenu should no longer add the postinst/postrm snippet for registering menu entries
Date: Mon, 30 May 2011 18:07:21 +0200
block 628564 by 628574
thanks

On Mon, 30 May 2011, Joey Hess wrote:
> Please see bug #518919. Also see menu's own documentation which
> still says update-menus has to be run.
> 
> Shall I reassign this bug to dpkg, or menu, or what?

I already cloned it against menu after Bill's answer. But please keep
it open for now at least until Bill replies to
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=628574#15

Depending on the outcome, we should either proceed with the removal
or adjust the postinst snippet to run update-menus only on initial
configuration.

I don't believe that the status quo is an acceptable outcome.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)




Added blocking bug(s) of 628564: 628574 Request was from Raphael Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Mon, 30 May 2011 16:09:08 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#628564; Package debhelper. (Tue, 31 May 2011 16:09:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Tue, 31 May 2011 16:09:07 GMT) Full text and rfc822 format available.

Message #34 received at 628564@bugs.debian.org (full text, mbox):

From: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
To: Raphael Hertzog <hertzog@debian.org>
Cc: Joey Hess <joeyh@debian.org>, 628564@bugs.debian.org
Subject: Re: Bug#628564: debhelper: dh_installmenu should no longer add the postinst/postrm snippet for registering menu entries
Date: Tue, 31 May 2011 18:07:25 +0200
On Mon, May 30, 2011 at 06:07:21PM +0200, Raphael Hertzog wrote:
> block 628564 by 628574
> thanks
> 
> On Mon, 30 May 2011, Joey Hess wrote:
> > Please see bug #518919. Also see menu's own documentation which
> > still says update-menus has to be run.
> > 
> > Shall I reassign this bug to dpkg, or menu, or what?
> 
> I already cloned it against menu after Bill's answer. But please keep
> it open for now at least until Bill replies to
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=628574#15
> 
> Depending on the outcome, we should either proceed with the removal
> or adjust the postinst snippet to run update-menus only on initial
> configuration.

Debhelper is correct. The issue you report is caused by menu having a useless
file debian/triggers. I will remove it.

> I don't believe that the status quo is an acceptable outcome.

Well, you could implement wishlist #556104 for dpkg.

Cheers,
-- 
Bill. <ballombe@debian.org>

Imagine a large red swirl here. 




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#628564; Package debhelper. (Tue, 31 May 2011 21:27:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Tue, 31 May 2011 21:27:07 GMT) Full text and rfc822 format available.

Message #39 received at 628564@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
Cc: Joey Hess <joeyh@debian.org>, 628564@bugs.debian.org
Subject: Re: Bug#628564: debhelper: dh_installmenu should no longer add the postinst/postrm snippet for registering menu entries
Date: Tue, 31 May 2011 23:18:40 +0200
On Tue, 31 May 2011, Bill Allombert wrote:
> Debhelper is correct. The issue you report is caused by menu having a useless
> file debian/triggers. I will remove it.

You still need a debian/triggers to declare an normal trigger (instead of
a file trigger).

But Bill, you have not replied to my proposal where menu would consider
packages already configured once as good enough to keep the menu entry.

Then you would get rid of the problem of menu entries disappearing on
simple upgrades, and you could keep the file trigger, and activate
the trigger in postinst only for initial install (and/or when you
see that the menu entry is currently desactivated). That would be
cleaner IMO.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#628564; Package debhelper. (Sat, 04 Jun 2011 10:03:17 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Sat, 04 Jun 2011 10:03:21 GMT) Full text and rfc822 format available.

Message #44 received at 628564@bugs.debian.org (full text, mbox):

From: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
To: Raphael Hertzog <hertzog@debian.org>
Cc: 628564@bugs.debian.org
Subject: Re: Bug#628564: debhelper: dh_installmenu should no longer add the postinst/postrm snippet for registering menu entries
Date: Sat, 4 Jun 2011 11:58:52 +0200
On Tue, May 31, 2011 at 11:18:40PM +0200, Raphael Hertzog wrote:
> On Tue, 31 May 2011, Bill Allombert wrote:
> > Debhelper is correct. The issue you report is caused by menu having a useless
> > file debian/triggers. I will remove it.
> 
> You still need a debian/triggers to declare an normal trigger (instead of
> a file trigger).

Yes.

> But Bill, you have not replied to my proposal where menu would consider
> packages already configured once as good enough to keep the menu entry.

Menu entries can be executable. In that case they are executed by update-menus
and the output is interpreted as a menu files. Menu must ensure that they are only
executed when the package is configured.

Cheers,
-- 
Bill. <ballombe@debian.org>

Imagine a large red swirl here. 




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#628564; Package debhelper. (Sat, 04 Jun 2011 13:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Sat, 04 Jun 2011 13:03:04 GMT) Full text and rfc822 format available.

Message #49 received at 628564@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
Cc: 628564@bugs.debian.org
Subject: Re: Bug#628564: debhelper: dh_installmenu should no longer add the postinst/postrm snippet for registering menu entries
Date: Sat, 4 Jun 2011 14:59:46 +0200
On Sat, 04 Jun 2011, Bill Allombert wrote:
> > But Bill, you have not replied to my proposal where menu would consider
> > packages already configured once as good enough to keep the menu entry.
> 
> Menu entries can be executable. In that case they are executed by update-menus
> and the output is interpreted as a menu files. Menu must ensure that they are only
> executed when the package is configured.

Menu must ensure that they are successfully executed once. It doesn't
matter that the package is configured or not.

In this case, the package has already been configured once. A new version
has been unpacked doesn't mean it's not working. It's highly unlikely that
a new dependency has been introduced due to the executable menu entries.
And even it this execution fails, you can still keep the former entry
or force a supplementary run in the postinst for the subset of packages
that use executables as menu entries.

Much like Pre-Depends are satisfied when a good version was already
configured once (even if another one got unpacked in the mean time), you
do not need more than this IMO.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 23:38:02 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.