tag 343423 patch
thanks
To reproduce this problem:
echo |apt-listchanges -f browser -a /var/cache/apt/archives/bar.deb
where browser runs "lynx" (not links/lynx-cur/...).
Note that it works without the echo |. The pipe causes lynx to
read(0)=0, causing it to exit.
apt-listchanges is launched with filenames piped on stdin, and --apt
on the commandline.
Browsers are spawned not only with a filename argument, but with stdin
reading from a pipe, which is connected one way or another to the same
contents of that filename; bug#196282 is revealing.
apt-listchanges should close(0) and open("/dev/tty") sometime before
launching the browser.
Attached is a patch implementing this. It might be better to keep the
close/open within the if block, but this patch, as given, allows easy
verification.
--- /usr/bin/apt-listchanges 2006-11-28 09:43:41.000000000 -0500
+++ /tmp/apt-listchanges 2007-01-11 14:01:32.000000000 -0500
@@ -24,7 +24,7 @@
# MA 02111-1307 USA
#
-import sys
+import sys, os
import apt_pkg
import locale
import gettext
@@ -52,7 +52,13 @@
apt_pkg.InitSystem()
if config.apt_mode:
+ # stdin is a pipe giving the list of debs
debs = apt_listchanges.read_apt_pipeline(config)
+
+ # Give any forked processes (eg. lynx) a normal stdin;
+ # See Debian Bug #343423
+ os.close(0)
+ tty = open('/dev/tty', 'r+')
if config.frontend == 'none':
sys.exit(0)
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]