[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.6-17-gcdad7ce

Sandro Tosi morph at debian.org
Wed Sep 2 21:12:47 UTC 2009


The following commit has been merged in the master branch:
commit 03ba0b3a6a01ab296c878bc6561fb970ba338d76
Author: Pierre Habouzit <madcoder at debian.org>
Date:   Sun Aug 30 19:13:51 2009 +0200

    Add support for release.debian.org pseudo-package.
    
    Signed-off-by: Pierre Habouzit <madcoder at debian.org>

diff --git a/bin/reportbug b/bin/reportbug
index 68f18d0..e9b7515 100755
--- a/bin/reportbug
+++ b/bin/reportbug
@@ -448,11 +448,11 @@ def get_package_name(bts='debian', mode=MODE_EXPERT):
                 False):
                 return get_package_name(bts, mode)
 
-        if package == 'ftp.debian.org':
+        if package == 'ftp.debian.org' or package == 'release.debian.org':
             if not ui.yes_no(
-                'Are you sure you want to file a bug on ftp.debian.org?',
+                'Are you sure you want to file a bug on %s?' % (package),
                 'Yes, I am a developer or know what I\'m doing.',
-                'No, I am not a developer and I don\'t know what ftp.debian.org is.',
+                'No, I am not a developer and I don\'t know what %s is.' % (package),
                 False):
                 return get_package_name(bts, mode)
 
@@ -1766,7 +1766,8 @@ For more details, please see: http://www.debian.org/devel/wnpp/''')
         HOMEDIR = os.environ.get('HOME', '/')
 
         if (rtype == 'debbugs' and not self.options.tags and
-            not (notatty or self.options.kudos or exinfo) and package not in ('wnpp','ftp.debian.org') and
+            not (notatty or self.options.kudos or exinfo) and
+            package not in ('wnpp','ftp.debian.org','release.debian.org') and
             mode > MODE_NOVICE):
             # Multiple-choice checkbox
             if severity in ('grave', 'critical', 'serious'):
diff --git a/debian/changelog b/debian/changelog
index 2a6bbcf..d895047 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
 reportbug (4.7) UNRELEASED; urgency=low
 
+  [ Sandro Tosi ]
   * reportbug/__init__.py
     - bump reportbug version
   * debian/control
@@ -17,6 +18,9 @@ reportbug (4.7) UNRELEASED; urgency=low
        LDAP support is gone since years; thanks to martin f krafft for the
        report; Closes: #271057
 
+  [ Pierre Habouzit ]
+  * Add support for the release.debian.org pseudo-package.
+
  -- Sandro Tosi <morph at debian.org>  Tue, 18 Aug 2009 09:39:44 +0200
 
 reportbug (4.6) unstable; urgency=low
diff --git a/reportbug/debianbts.py b/reportbug/debianbts.py
index 212a7ee..25de917 100644
--- a/reportbug/debianbts.py
+++ b/reportbug/debianbts.py
@@ -317,6 +317,120 @@ def handle_debian_ftp(package, bts, ui, fromaddr, online=True, http_proxy=None):
     return (subject, severity, headers, pseudos, body, query)
 
 
+def handle_debian_release(package, bts, ui, fromaddr, online=True, http_proxy=None):
+    body = ''
+    headers = []
+    pseudos = []
+    query = True
+    archs = None
+    version = None
+
+    tag = ui.menu('What sort of request is this?  (If none of these '
+                  'things mean anything to you, or you are trying to report '
+                  'a bug in an existing package, please press Enter to '
+                  'exit reportbug.)', {
+        'binnmu':           "binNMU requests",
+        'transition':       "transition tracking",
+        'unblock':          "unblock requests",
+        'freeze-exception': "Freeze exceptions",
+        'opu':              "oldstable proposed updates requests",
+        'pu':               "stable proposed updates requests",
+        'rm':               "Stable/Testing removal requests",
+        'other' :           "None of the above",
+        }, 'Choose the request type: ', empty_ok=True)
+    if not tag:
+        ui.long_message('To report a bug in a package, use the name of the package, not release.debian.org.\n')
+        raise SystemExit
+
+    severity = 'normal'
+    if tag == 'other':
+        return
+
+    prompt  = 'Please enter the name of the package: '
+    package = ui.get_string(prompt)
+    if not package:
+        ui.log_message('You seem to want to report a generic bug, not request a removal\n')
+        return
+
+    ui.log_message('Checking status database...\n')
+    info = utils.get_package_status(package)
+    available = info[1]
+
+    query = False
+    if not available:
+        info = utils.get_source_package(package)
+        if info:
+            info = utils.get_package_status(info[0][0])
+
+    if not info:
+        cont = ui.select_options(
+            "This package doesn't appear to exist; continue?",
+            'yN', {'y': 'Ignore this problem and continue.',
+                   'n': 'Exit without filing a report.' })
+        if cont == 'n':
+            sys.exit(1)
+    else:
+        package = info[12] or package
+
+    if tag in ('binnmu', 'unblock', 'freeze-exceptions', 'opu', 'pu', 'rm'):
+        # FIXME: opu/pu/rm should lookup the version elsewhere
+        version = info and info[0]
+        if version:
+            cont = ui.select_options(
+                "Latest version seems to be %s, is this the proper one ?" % (version),
+                "Yn", {'y': "This is the correct version",
+                       'n': "Enter the proper vesion"})
+            if cont == 'n':
+                version = None
+        if not version:
+            version = ui.get_string('Please enter the version of the package: ')
+            if not version:
+                ui.log_message("A version is required for action %s, not sending bug\n" % (tag))
+                return
+
+    if tag in ('binnmu'):
+        partial = ui.select_options(
+            "Is this request for specific architectures?",
+            'yN', {'y': 'This is a partial (specific architectures) removal.',
+                   'n': 'This removal is for all architectures.' })
+        if partial == 'y':
+            prompt = 'Please enter the arch list separated by a space: '
+            archs = ui.get_string(prompt)
+            if not archs:
+                ui.long_message('Partial removal requests must have a list of architectures.\n')
+                raise SystemExit
+
+    pseudos.append("User: debian-release at lists.debian.org")
+    pseudos.append("Usertags: %s" % (tag))
+
+    if tag == 'binnmu':
+        reason  = ui.get_string("binNMU changelog entry: ")
+        subject = "nmu: %s/%s" % (package, version)
+        body    = "nmu %s/%s . %s . -m \"%s\"\n" % (package, version, archs, reason)
+    elif tag == 'transition':
+        subject = 'transition: %s' % (package)
+        body    = '(please explain about the transition: impacted packages, reason, ...)\n'
+    elif tag == 'unblock' or tag == 'freeze-exception':
+        subject = 'unblock: %s/%s' % (package, version)
+        body    = textwrap.dedent(u"""\
+                Please unblock package %s
+
+                (explain the reason for the unblock here)
+
+                unblock %s/%s
+                """ % (package, package, version))
+    elif tag == 'pu' or tag == 'opu':
+        subject = '%s: package %s/%s' % (tag, package, version)
+        body    = '(please explain the reason for this update here)\n'
+    elif tag == 'rm':
+        if archs:
+            subject = 'RM: %s/%s [%s]' % (package, version, archs)
+        else:
+            subject = 'RM: %s/%s' % (package, version)
+        body = ''
+
+    return (subject, severity, headers, pseudos, body, query)
+
 itp_template = textwrap.dedent(u"""\
     * Package name    : %(package)s
       Version         : x.y.z
@@ -478,7 +592,8 @@ SYSTEMS = { 'debian' :
               'nonvirtual' : ['linux-image', 'kernel-image'],
               'specials' :
                 { 'wnpp': handle_wnpp,
-                  'ftp.debian.org': handle_debian_ftp },
+                  'ftp.debian.org': handle_debian_ftp,
+                  'release.debian.org': handle_debian_release },
               # Dependency packages
               'deppkgs' : ('gcc', 'g++', 'cpp', 'gcj', 'gpc', 'gobjc',
                            'chill', 'gij', 'g77', 'python', 'python-base',

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list