[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.9-107-gfb30b03
Sandro Tosi
morph at debian.org
Sat Jun 5 09:05:05 UTC 2010
The following commit has been merged in the master branch:
commit fb30b03305bdcae698efd94547a442dc208eb028
Author: Sandro Tosi <morph at debian.org>
Date: Sat Jun 5 11:02:41 2010 +0200
don't present suite tags ('sid', 'lenny', etc) when running in modes lower than 'advanced'; thanks to Julien Cristau for the report; Closes: #583890
The "core" change is to split the tags list in normal/expert ones, and then add
a 'mode' keyword argument to debianbts.get_tags() method, and merge the expert
list if mode fits.
In order to do this, we needed to move a couple of imports in utils after the
definition of MODES_* variables:
- debianbts, it directly accesses those vars
- ui.text_ui, needs to be after debianbts
diff --git a/bin/reportbug b/bin/reportbug
index fbf9fab..b11a78a 100755
--- a/bin/reportbug
+++ b/bin/reportbug
@@ -316,7 +316,7 @@ def handle_editing(filename, dmessage, options, sendto, attachments, package,
elif x == 't':
newtaglist = []
skip_editing = True
- ntags = debianbts.get_tags(severity)
+ ntags = debianbts.get_tags(severity, mode)
newtaglist = ui.select_multiple(
'Do any of the following apply to this report?', ntags,
'Please select tags: ')
@@ -1898,7 +1898,7 @@ For more details, please see: http://www.debian.org/devel/wnpp/''')
not (notatty or self.options.kudos or exinfo) and
package not in ('wnpp', 'ftp.debian.org', 'release.debian.org') and
mode > MODE_NOVICE and self.options.tagsmenu):
- tags = debianbts.get_tags(severity)
+ tags = debianbts.get_tags(severity, mode)
taglist = ui.select_multiple(
'Do any of the following apply to this report?', tags,
diff --git a/debian/changelog b/debian/changelog
index 232ba1a..5177adc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,8 +7,11 @@ reportbug (4.12.3) UNRELEASED; urgency=low
- when configuring, show the complete text about SMTP host (part was hidden
if using GTK+ UI); thanks to Elie De Brauwer for the report and patch;
Closes: #583292
+ * bin/reportbug, reportbug/{debianbts.py, utils.py}
+ - don't present suite tags ('sid', 'lenny', etc) when running in modes lower
+ than 'advanced'; thanks to Julien Cristau for the report; Closes: #583890
- -- Sandro Tosi <morph at debian.org> Thu, 27 May 2010 22:20:51 +0200
+ -- Sandro Tosi <morph at debian.org> Sat, 05 Jun 2010 10:38:05 +0200
reportbug (4.12.2) unstable; urgency=low
diff --git a/reportbug/debianbts.py b/reportbug/debianbts.py
index d9a1cda..5edeef1 100644
--- a/reportbug/debianbts.py
+++ b/reportbug/debianbts.py
@@ -640,30 +640,37 @@ CRITICAL_TAGS = {
'security' : 'This problem is a security vulnerability in Debian.',
}
+EXPERT_TAGS = {
+ 'lenny' : 'This bug only applies to the lenny release (Debian 5.0).',
+ 'squeeze' : 'This bug only applies to the squeeze release.',
+ 'sid' : 'This bug only applies to the unstable branch of Debian.',
+ 'experimental' : 'This bug only applies to the experimental branch of Debian.'
+}
+
TAGS = {
'patch' : 'You are including a patch to fix this problem.',
'upstream' : 'This bug applies to the upstream part of the package.',
'd-i' : 'This bug is relevant to the development of debian-installer.',
'ipv6' : 'This bug affects support for Internet Protocol version 6.',
'lfs' : 'This bug affects support for large files (over 2 gigabytes).',
- 'lenny' : 'This bug only applies to the lenny release (Debian 5.0).',
- 'squeeze' : 'This bug only applies to the squeeze release.',
- 'sid' : 'This bug only applies to the unstable branch of Debian.',
- 'experimental' : 'This bug only applies to the experimental branch of Debian.',
'l10n' : 'This bug reports a localization/internationalization issue.'
}
-def get_tags(severity=''):
+def get_tags(severity='', mode=utils.MODE_NOVICE):
"""Returns the current tags list.
- If severity is release critical, than add additional tags not always present."""
+ If severity is release critical, than add additional tags not always present.
+ If mode is higher than STANDARD, then add suite tags."""
+
+ tags = TAGS.copy()
if severity in ('grave', 'critical', 'serious'):
- temp_tags = TAGS.copy()
- temp_tags.update(CRITICAL_TAGS)
- return temp_tags
- else:
- return TAGS
+ tags.update(CRITICAL_TAGS)
+
+ if mode > utils.MODE_STANDARD:
+ tags.update(EXPERT_TAGS)
+
+ return tags
def yn_bool(setting):
if setting:
diff --git a/reportbug/utils.py b/reportbug/utils.py
index 7cc12e6..3048d61 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -43,12 +43,8 @@ import rfc822
import socket
import subprocess
-import debianbts
from string import ascii_letters, digits
-# needed for MUA send
-import ui.text_ui as ui
-
# Paths for dpkg
DPKGLIB = '/var/lib/dpkg'
AVAILDB = os.path.join(DPKGLIB, 'available')
@@ -75,6 +71,11 @@ for mode in MODELIST:
exec 'MODE_%s=%d' % (mode.upper(), MODELIST.index(mode))
del mode
+# moved here since it needs the MODE_* vars to be defined
+import debianbts
+# it needs to be imported after debianbts
+import ui.text_ui as ui
+
NEWBIELINE = '*** Please type your report below this line ***'
fhs_directories = ['/', '/usr', '/usr/share', '/var', '/usr/X11R6',
--
Reportbug - reports bugs in the Debian distribution
More information about the Reportbug-commits
mailing list