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)
--- update-menus/update-menus.cc.orig 2011-05-30 12:10:04.000000000 +0200
+++ update-menus/update-menus.cc 2011-05-30 12:48:36.000000000 +0200
@@ -437,8 +437,9 @@
// Here we get the list of *installed* packages from dpkg, using sed to
// retrieve the package name.
string inst_states="installed\\|triggers-awaited\\|triggers-pending";
- string pkgs = "dpkg-query --show --showformat=\"\\${status} \\${provides}
\\${package}\\n\" | sed -n -e \"/" + inst_states
- + " /{s/^.*\\("+inst_states+"\\) *//; s/[, ][, ]*/\\n/g; p}\"";
+ string pkgs = "dpkg-query --show --showformat=\"\\${status} \\${provides}
\\${package} \\${config-version}\\n\" | sed -n -e \"/" + inst_states
+ + " / b select; /[^ ]\\$/ b select; d;"
+ + ":select{s/^[^ ]* [^ ]* [^ ]* //; s/ [^ ]*\\$//; s/[, ][,
]*/\\n/g; p; d}\"";
pkgs = "exec /bin/bash -o pipefail -c '" + pkgs + "'";
FILE *status = popen(pkgs.c_str(), "r");