Bug#341701: Bug#452801: menu: Does not consider virtual packages as installed
Bill Allombert writes: Hi, Please try the script in the bug #462648: it report a failure if I apply the patch... I did some research and it turned out that the patch I sent you yesterday accidentally fixes the problem ;) Without the patch the 'dpkg-query | sed' pipe always fails when update-menus runs in background. There're two reasons of this: - In background mode update-menus closes all file descriptors and than reopens stdin for /tmp/update-menus.xxx file (keeping stderr closed). - For some unknown reason sed fails when stderr is closed, e.g.: sed -e '' /dev/null 2- || echo failed with $? Regards, robert -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#341701: Bug#452801: menu: Does not consider virtual packages as installed
Bill Allombert writes: Hi, Well, I applied the following patch (w.r.t the CVS version) and this breaks menu auto-update feature. This is very strange. What do you mean by this? I got the current CVS version, built it and installed and everything seemed to work OK. BTW. I've discovered that the /tmp/update-menus.XXX log files are never written into. Attached patch fixes this minor issue. Regards, robert Index: update-menus.cc === RCS file: /cvsroot/menu/menu/update-menus/update-menus.cc,v retrieving revision 1.59 diff -u -r1.59 update-menus.cc --- update-menus.cc 27 Feb 2008 13:31:03 - 1.59 +++ update-menus.cc 5 Mar 2008 21:31:54 - @@ -1022,9 +1025,12 @@ wait_dpkg(stdoutfile); if(!stdoutfile.empty()) { close(1); - open(stdoutfile.c_str(), O_WRONLY|O_CREAT|O_SYNC|O_EXCL, 0666); close(2); - dup2(1,2); + int i = open(stdoutfile.c_str(), O_WRONLY|O_CREAT|O_SYNC|O_EXCL, 0666); + if (i != 2) { + dup2(i,2); + close(i); + } } if (config.remove_menu) { }
Bug#341701: Bug#452801: menu: Does not consider virtual packages as installed
On Wed, Mar 05, 2008 at 10:45:26PM +0100, Robert Luberda wrote: Bill Allombert writes: Hi, Well, I applied the following patch (w.r.t the CVS version) and this breaks menu auto-update feature. This is very strange. What do you mean by this? I got the current CVS version, built it and installed and everything seemed to work OK. Please try the script in the bug #462648: it report a failure if I apply the patch... BTW. I've discovered that the /tmp/update-menus.XXX log files are never written into. Attached patch fixes this minor issue. Thanks you very much for this fix! Cheers, -- Bill. [EMAIL PROTECTED] Imagine a large red swirl here. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#341701: Bug#452801: menu: Does not consider virtual packages as installed
On Sun, Jan 27, 2008 at 11:26:40AM +0100, Robert Luberda wrote: tags 341701 patch thanks Bill Allombert writes: Hi, Thanks a lot, it seems fine. By any chance do you have an idea how to fix bug #341701 ? The problem is the standard shell returns exit status of the last command as the status of pipe. You can obey this either by avoiding the pipe (i.e. running only dpkg-query and do filtering directly in update-menus) or by using non-POSIX `pipefail' option (so you need to make sure shell supports it). A simple patch for the second solution: In read_packages() just after initialization of pkgs variable add the following line: pkgs = exec /bin/bash -o pipefail -c \ + pkgs + \; Of course you need to check return value of pclose() call, e.g.: if (pclose(status)) { exit (1); } Well, I applied the following patch (w.r.t the CVS version) and this breaks menu auto-update feature. This is very strange. Cheers, -- Bill. [EMAIL PROTECTED] Imagine a large red swirl here. Index: update-menus/update-menus.cc === RCS file: /cvsroot/menu/menu/update-menus/update-menus.cc,v retrieving revision 1.59 diff -u -r1.59 update-menus.cc --- update-menus/update-menus.cc27 Feb 2008 13:31:03 - 1.59 +++ update-menus/update-menus.cc3 Mar 2008 19:37:04 - @@ -436,7 +436,8 @@ { // Here we get the list of *installed* packages from dpkg, using sed to // retrieve the package name. - string pkgs = dpkg-query --show --showformat='${status} ${provides} ${package}\\n' | sed -n -e '/installed /{s/^.*installed *//; s/[, ][, ]*/\\n/g; p}'; + string pkgs = dpkg-query --show --showformat=\\\${status} \\${provides} \\${package}\\n\ | sed -n -e \/installed /{s/^.*installed *//; s/[, ][, ]*/\\n/g; p}\; + pkgs = exec /bin/bash -o pipefail -c ' + pkgs + '; FILE *status = popen(pkgs.c_str(), r); if (!status) @@ -455,7 +456,8 @@ installed_packages.insert(tmp); } } - pclose(status); + if (pclose(status)) +throw pipeerror_read(pkgs.c_str()); } /** Read a menufile and create one (or more) menu entries for it.
Bug#341701: Bug#452801: menu: Does not consider virtual packages as installed
tags 341701 patch thanks Bill Allombert writes: Hi, Thanks a lot, it seems fine. By any chance do you have an idea how to fix bug #341701 ? The problem is the standard shell returns exit status of the last command as the status of pipe. You can obey this either by avoiding the pipe (i.e. running only dpkg-query and do filtering directly in update-menus) or by using non-POSIX `pipefail' option (so you need to make sure shell supports it). A simple patch for the second solution: In read_packages() just after initialization of pkgs variable add the following line: pkgs = exec /bin/bash -o pipefail -c \ + pkgs + \; Of course you need to check return value of pclose() call, e.g.: if (pclose(status)) { exit (1); } Regards, robert -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#452801: menu: Does not consider virtual packages as installed
tags 452801 patch quit Bill Allombert writes: update-menus is not documented as handling virtual package. I have no idea how to implement that See attached patch ;) or even if it is a good idea I'm not sure too. However at least one package (gvim) would benefit from it. The situation of /usr/share/menu/vim-gui-common is more complex: There are several packages providing gvim and they can be installed together. There are no reason to provide a menu entry for only one of them, which is not even specified in the title. All of the packages have similar (or even identical) functionality - this could be the reason. Regards, robert --- update-menus.cc_ 2007-07-10 19:23:12.0 +0200 +++ update-menus.cc 2008-01-21 21:03:52.0 +0100 @@ -435,7 +435,7 @@ { // Here we get the list of *installed* packages from dpkg, using sed to // retrieve the package name. - char *pkgs = dpkg-query --show --showformat='${status} ${package}\\n' | sed -n -e 's/.*installed *//p'; + char *pkgs = dpkg-query --show --showformat='${status} ${provides} ${package}\\n' | sed -n -e '/installed /{s/^.*installed *//; s/[, ][, ]*/\\n/g; p}'; FILE *status = popen(pkgs, r); if (!status)
Bug#452801: menu: Does not consider virtual packages as installed
On Mon, Jan 21, 2008 at 10:13:41PM +0100, Robert Luberda wrote: tags 452801 patch quit Bill Allombert writes: update-menus is not documented as handling virtual package. I have no idea how to implement that See attached patch ;) Thanks a lot, it seems fine. By any chance do you have an idea how to fix bug #341701 ? Cheers, -- Bill. [EMAIL PROTECTED] Imagine a large red swirl here. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#452801: menu: Does not consider virtual packages as installed
severity 452801 wishlist quit On Sun, Nov 25, 2007 at 11:11:43AM +0100, Robert Luberda wrote: Package: menu Version: 2.1.36 Severity: normal Hi, update-menus -v displays the following warnings: update-menus[4398]: Reading menu-entry files in /usr/share/menu/. update-menus[4398]: file /usr/share/menu/alsaplayer-daemon line 8: Discarding entry requiring missing package x-terminal-emulator. update-menus[4398]: file /usr/share/menu/vim-gui-common line 9: Discarding entry requiring missing package gvim. Both gvim and x-terminal-emulator are virtual packages, and I have at least one package providing them installed: Hello Robert, update-menus is not documented as handling virtual package. I have no idea how to implement that or even if it is a good idea. /usr/share/menu/alsaplayer-daemon is clear bogus. I report it as bug #461764 The situation of /usr/share/menu/vim-gui-common is more complex: There are several packages providing gvim and they can be installed together. There are no reason to provide a menu entry for only one of them, which is not even specified in the title. Thanks for reporting theses issues. In any case, I have no clue how to implement that feature. Cheers, -- Bill. [EMAIL PROTECTED] Imagine a large red swirl here. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#452801: menu: Does not consider virtual packages as installed
Package: menu Version: 2.1.36 Severity: normal Hi, update-menus -v displays the following warnings: update-menus[4398]: Reading menu-entry files in /usr/share/menu/. update-menus[4398]: file /usr/share/menu/alsaplayer-daemon line 8: Discarding entry requiring missing package x-terminal-emulator. update-menus[4398]: file /usr/share/menu/vim-gui-common line 9: Discarding entry requiring missing package gvim. Both gvim and x-terminal-emulator are virtual packages, and I have at least one package providing them installed: [136]/home/robert grep-status -e -FProvides '(gvim|x-terminal-emulator)' -s Package,Version,Provides | tbl-dctrl -c Package -c Version -c Provides:20 +==+==+==+ | Package | Version | Provides | +--+--+--+ | vim-gtk | 1:7.1-138+1 | gvim, editor | | konsole | 4:3.5.8.dfsg.1-2 | x-terminal-emulator | | wterm| 6.2.9-8 | x-terminal-emulator | | rxvt | 1:2.6.4-12 | x-terminal-emulator | | xterm| 229-1| x-terminal-emulator | [..skipped...] Best Regards, robert -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (990, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.22 Locale: LANG=pl_PL, LC_CTYPE=pl_PL (charmap=ISO-8859-2) Shell: /bin/sh linked to /bin/pdksh Versions of packages menu depends on: ii dpkg 1.14.11package maintenance system for Deb ii libc6 2.6.1-6GNU C Library: Shared libraries ii libgcc1 1:4.2.2-3 GCC support library ii libstdc++64.2.2-3The GNU Standard C++ Library v3 menu recommends no packages. -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]