On Mon, 24 Oct 2011 00:16:18 -0400 Joe Nahmias wrote:

[...]
> On Sun, Oct 23, 2011 at 06:54:19PM +0200, Francesco Poli wrote:
> > On Sun, 23 Oct 2011 12:01:06 -0400 Joseph Nahmias wrote:
[...]
> > This looks weird...
> > 
> > apt-listbugs should invoke
> > 
> >   /usr/bin/querybts 644254 < /dev/tty
> > 
> > when you enter that bug number at the above-quoted prompt.
> > 
> > It really seems that a graphical web browser is being invoked and fails
> > to start, since (I suppose) you are root and have no access to any
> > running X server display...

I was thinking about this: most probably, what is being invoked here is
not a web browser, as I first thought, but rather a graphical querybts
interface based on Python GTK+ bindings...
Anyway, this does not change the substance of the issue.

> > 
> > What happens if you try to manually issue the above-mentioned querybts
> > command from the same environment (e.g.: from the same shell with root
> > privileges)?
> 
> Here's what happens when I run as myself and via sudo:
> 
> joe@wakko:~$ /usr/bin/querybts 644254 < /dev/tty
> Retrieving report #644254 from Debian bug tracking system...
> What do you want to do now? [N|x|o|r|b|e|q|?]? q
> Exiting.

When invoked from your regular user, querybts uses the text interface,
since you have "ui text" in your /home/joe/.reportbugrc (as you show
below).
OK, this seems to be the expected behavior.

> joe@wakko:~$ sudo /usr/bin/querybts 644254 < /dev/tty
> [sudo] password for joe: 
> No protocol specified
> /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: 
> could not open display
>   warnings.warn(str(e), _gtk.Warning)
> Retrieving report #644254 from Debian bug tracking system...
> What do you want to do now? [N|x|o|r|b|e|q|?]? q
> Exiting.

When invoked from sudo, querybts seems to first try the gtk2 interface
and then to fall back to the text interface.

This puzzles me a bit: I don't know why I don't see the same behavior.
Maybe you have some additional packages (suggested by reportbug).
What's the output of the following command on your system?

  dpkg -l | egrep 'python-urw|python-gtk|python-vte'

But, more importantly, I wonder why you don't see the same behavior when
querybts is invoked by apt-listbugs...

I'll try to reproduce the issue in a sid chroot (tonight, hopefully).

> 
> > Did you customize your root (or system-wide) configuration for
> > reportbug? Do you have "ui gtk2" in your /etc/reportbug.conf
> > or /root/.reportbugrc , by chance?
> 
> Here's what I have:
> 
> joe@wakko:~$ sudo egrep -vn '^(#|$)' /etc/reportbug.conf /root/.reportbugrc 
> ~/.reportbugrc
> /etc/reportbug.conf:15:submit
> /etc/reportbug.conf:32:query-bts
> /etc/reportbug.conf:38:cc
> /etc/reportbug.conf:41:config-files
> /etc/reportbug.conf:44:compress
> /etc/reportbug.conf:103:verify
> egrep: /root/.reportbugrc: No such file or directory
> /home/joe/.reportbugrc:3:reportbug_version "3.8"
> /home/joe/.reportbugrc:5:mode expert
> /home/joe/.reportbugrc:7:ui text
> /home/joe/.reportbugrc:11:realname "Joseph Nahmias"
> /home/joe/.reportbugrc:12:email "j...@nahmias.net"
> /home/joe/.reportbugrc:15:no-cc
> /home/joe/.reportbugrc:16:header "X-Debbugs-CC: j...@nahmias.net"
> /home/joe/.reportbugrc:17:smtphost reportbug.debian.org

So no "ui gtk2" for root.
But no "ui text" either...
Maybe that's why querybts tried each available interface.
Unfortunately, I am not familiar with querybts source code...  :-(
...and it shows!   ;-)

I am tempted to add the "-u text" option to the querybts invocation.
That is to say, I could conclude that line 374
of /usr/share/apt-listbugs/apt-listbugs/logic.rb should be changed from

  system("#{@config.querybts} #{$1} < /dev/tty")

to

  system("#{@config.querybts} -u text #{$1} < /dev/tty")

Feel free to try this modification out, if you like...

> 
> 
> 
> Also, another (perhaps related) oddity is that when invoked from apt-get
> dist-upgrade it doesn't seem to be in "listbugs mode" when it does this
> and I get a message that a particular command can't be run in standalone
> mode.

I cannot understand what you mean here.
Could you please elaborate?

> 
> Hope this helps,

It helps, but the mystery deepens more and more!   ;-)


-- 
 http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt
 New GnuPG key, see the transition document!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE

Attachment: pgpJFHMytRN9B.pgp
Description: PGP signature

Reply via email to