[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.9-87-g486eccb

Sandro Tosi morph at debian.org
Sun Apr 4 21:49:37 UTC 2010


The following commit has been merged in the master branch:
commit bad5a517ae2849241f72a639314b390a0223b7bb
Author: Sandro Tosi <morph at debian.org>
Date:   Sun Apr 4 19:40:01 2010 +0200

    added the '--source/--src' command-line option, to report bugs against the source package instead of the binary one; thanks to Cyril Brulebois for the report; Closes: #560230

diff --git a/bin/reportbug b/bin/reportbug
index 0947bfe..bc45309 100755
--- a/bin/reportbug
+++ b/bin/reportbug
@@ -853,6 +853,9 @@ def main():
     parser.add_option('--smtphost', help='specify SMTP server for mailing')
     parser.add_option('--tls', help='use TLS to talk to SMTP servers',
                       dest="smtptls", action='store_true')
+    parser.add_option('--source', '--src', dest='source', default=False,
+                      help='report the bug against the source package ',
+                      action='store_true')
     parser.add_option('--smtpuser', help='username to use for SMTP')
     parser.add_option('--smtppasswd', help='password to use for SMTP')
     parser.add_option('--replyto', '--reply-to', help='specify Reply-To '
@@ -1180,6 +1183,9 @@ class UI(object):
             package = self.args[0]
             if package and package.startswith('/'):
                 (foundfile, package) = find_package_for(package, notatty)
+            elif package and self.options.source:
+                # convert it to the source package if we are reporting for src
+                package = utils.get_source_name(package)
 
         others = debianbts.SYSTEMS[bts].get('otherpkgs')
         if package == 'other' and others:
@@ -1944,7 +1950,8 @@ For more details, please see: http://www.debian.org/devel/wnpp/''')
             message = utils.generate_blank_report(
                 submitas or package, pkgversion, severity, justification,
                 depinfo, conftext, foundfile, incfiles, bts, exinfo, rtype,
-                klass, subject, tags, body, mode, pseudos, debsumsoutput)
+                klass, subject, tags, body, mode, pseudos, debsumsoutput,
+                issource=self.options.source)
 
         # Substitute server email address
         if submitto and '@' not in sendto:
diff --git a/debian/changelog b/debian/changelog
index c074845..3c91409 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -35,8 +35,12 @@ reportbug (4.12) UNRELEASED; urgency=low
     - restore the functionality that includes changed conffile into the bug
       report, that went broken log ago; thanks to Håkon Stordahl for the report
       and patch; Closes: #503131
+  * bin/reportbug, man/reportbug.1, reportbug/{bugreport.py, utils.py}
+    - added the '--source/--src' command-line option, to report bugs against the
+      source package instead of the binary one; thanks to Cyril Brulebois for
+      the report; Closes: #560230
 
- -- Sandro Tosi <morph at debian.org>  Sat, 03 Apr 2010 19:00:08 +0200
+ -- Sandro Tosi <morph at debian.org>  Sun, 04 Apr 2010 19:35:12 +0200
 
 reportbug (4.11) unstable; urgency=low
 
diff --git a/man/reportbug.1 b/man/reportbug.1
index fb4dfcc..d0b1f43 100644
--- a/man/reportbug.1
+++ b/man/reportbug.1
@@ -383,6 +383,10 @@ should set this option in \fB$HOME/.reportbugrc\fP and ensure it is
 only readable by your user (e.g. with \fBchmod 600
 $HOME/.reportbugrc\fP).
 .TP
+.B \-\-src, \-\-source
+Specify to report the bug against the source package, and not the
+binary package (default behaviour).
+.TP
 .B \-t TYPE, \-\-type=TYPE
 Specify the type of report to be submitted; currently accepts either
 \fBgnats\fP or \fBdebbugs\fP.
diff --git a/reportbug/bugreport.py b/reportbug/bugreport.py
index 243f8fa..b70667f 100644
--- a/reportbug/bugreport.py
+++ b/reportbug/bugreport.py
@@ -39,7 +39,7 @@ class bugreport(object):
     def __init__(self, package, subject='', body='', system='debian',
                  incfiles='', sysinfo=True,
                  followup=False, type='debbugs', mode=utils.MODE_STANDARD,
-                 debsumsoutput=None, **props):
+                 debsumsoutput=None, issource=False, **props):
         self.type = type
         for (k, v) in props.iteritems():
             setattr(self, k, v)
@@ -52,6 +52,7 @@ class bugreport(object):
         self.incfiles = incfiles
         self.sysinfo = sysinfo
         self.debsumsoutput = debsumsoutput
+        self.issource = issource
 
     def tset(self, value):
         if value not in ('debbugs', 'launchpad'):
@@ -105,6 +106,11 @@ class bugreport(object):
         elif not body:
             body = u'\n'
 
+        if self.issource:
+            reportto = 'Source'
+        else:
+            reportto = 'Package'
+
         if not self.followup:
             for (attr, name) in dict(severity='Severity',
                                      justification='Justification',
@@ -114,10 +120,10 @@ class bugreport(object):
                 if a:
                     headers += u'%s: %s\n' % (name, a)
             
-            report = u"Package: %s\n%s\n" % (self.package, headers)
+            report = u"%s: %s\n%s\n" % (reportto, self.package, headers)
         else:
-            report = "Followup-For: Bug #%d\nPackage: %s\n%s\n" % (
-                self.followup, self.package, headers)
+            report = "Followup-For: Bug #%d\n%s: %s\n%s\n" % (
+                self.followup, reportto, self.package, headers)
 
         infofunc = debianbts.SYSTEMS[self.system].get('infofunc', debianbts.generic_infofunc)
         if infofunc:
diff --git a/reportbug/utils.py b/reportbug/utils.py
index 126eb80..ce7d82d 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -729,7 +729,7 @@ def generate_blank_report(package, pkgversion, severity, justification,
                           depinfo, confinfo, foundfile='', incfiles='',
                           system='debian', exinfo=0, type=None, klass='',
                           subject='', tags='', body='', mode=MODE_EXPERT,
-                          pseudos=None, debsumsoutput=None):
+                          pseudos=None, debsumsoutput=None, issource=False):
     # For now...
     import bugreport
 
@@ -741,7 +741,7 @@ def generate_blank_report(package, pkgversion, severity, justification,
                               pseudoheaders=pseudos, exinfo=exinfo, type=type,
                               system=system, depinfo=depinfo, sysinfo=sysinfo,
                               confinfo=confinfo, incfiles=incfiles,
-                              debsumsoutput=debsumsoutput)
+                              debsumsoutput=debsumsoutput, issource=issource)
     return unicode(rep)
 
 def get_cpu_cores():

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list