[Reportbug-maint] Bug#511210: reportbug: changed semantics of the --template option can break non-interactive use

Håkon Stordahl hakon at stordahl.org
Thu Jan 8 14:50:28 UTC 2009

Package: reportbug
Version: 3.99.0
Severity: normal

It seems that in version 3.43 the way that the --template option works
was slightly changed, so that if a package has a bug script, it will
be executed and the output will be included in the template. This was
not the case with earlier versions where using the --template would not
cause the script in /usr/share/bug/PACKAGE/script to be executed.

Unfortunately this change can cause problems when it's necessary to
call reportbug with the --template option non-interactively, for
example from a script, because some packages' bug scripts are

Specifically the function debian-bug, provided by the debian-el
package to report bugs from Emacs, needs to call reportbug with the
--template option, and thus will have problems when used with a
package that has a bug script that is requesting input from the user.
See bug report #502426.

Apparently, this has also been an issue before. See for example bug

I'm not sure what is the best approach here, but I've attached a patch
suggesting the implementation of a --no-bug-script option. Though, as
said, I'm not sure whether this would be the best thing to do, as I
realize it might not be optimal to add even more options to reportbug.
Also, in the patch I've removed the condition (interactive or
self.options.template) in the test of whether to execute the bug
script, since it seems to be a tautology: interactive is only set to
false if self.options.template is true. Furthermore, since this leaves
only one case where the variable interactive is referenced, and since
interactive is directly dependent on self.options.template, I replaced
that reference with a reference to self.options.template and removed
the variable interactive altogether.

-- Package-specific info:
** Environment settings:
EMAIL="hakon at stordahl.org"

** /home/haakonst/.reportbugrc:
mode standard
ui text
realname "Håkon Stordahl"
email "hakon at stordahl.org"

-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages reportbug depends on:
ii  apt                           0.7.20     Advanced front-end for dpkg
ii  python                        2.5.2-3    An interactive high-level object-o
ii  python-reportbug              3.99.0     Python modules for interacting wit

reportbug recommends no packages.

Versions of packages reportbug suggests:
ii  debconf-utils                 1.5.24     debconf utilities
ii  debsums                       2.0.40     verification of installed package 
ii  dlocate                       0.96.1     fast alternative to dpkg -L and dp
ii  exim4                         4.69-9     metapackage to ease Exim MTA (v4) 
ii  exim4-daemon-light [mail-tran 4.69-9     lightweight Exim MTA (v4) daemon
ii  file                          4.26-2     Determines file type using "magic"
ii  gnupg                         1.4.9-3    GNU privacy guard - a free PGP rep
ii  python-gtk2                   2.12.1-6   Python bindings for the GTK+ widge
ii  python-urwid          curses-based UI/widget library for

-- no debconf information

-------------- next part --------------
A non-text attachment was scrubbed...
Name: reportbug-3.99.0_no_bug_script.diff
Type: text/x-diff
Size: 2671 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/reportbug-maint/attachments/20090108/7c5d5c6b/attachment.diff 

More information about the Reportbug-maint mailing list