diff -Nru reportbug-6.4.4ubuntu1/bin/querybts reportbug-6.5.0ubuntu1/bin/querybts --- reportbug-6.4.4ubuntu1/bin/querybts 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/bin/querybts 2014-01-28 19:01:38.000000000 +0000 @@ -3,7 +3,7 @@ # querybts - Examine the state of a debbugs server # Written by Chris Lawrence # (C) 1999-2008 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # diff -Nru reportbug-6.4.4ubuntu1/bin/reportbug reportbug-6.5.0ubuntu1/bin/reportbug --- reportbug-6.4.4ubuntu1/bin/reportbug 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/bin/reportbug 2014-01-28 19:01:38.000000000 +0000 @@ -3,7 +3,7 @@ # reportbug - Report a bug in the Debian distribution. # Written by Chris Lawrence # Copyright (C) 1999-2008 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # @@ -587,7 +587,6 @@ is_addr_ok = utils.check_email_addr(from_addr) if not is_addr_ok: ewrite('Your email address is not valid; please try another one.\n') - stupidmode = not ui.yes_no( 'Do you have a "mail transport agent" (MTA) like Exim, Postfix or ' 'SSMTP configured on this computer to send mail to the Internet?', @@ -595,7 +594,7 @@ 'If you can send email from this machine without setting an SMTP Host ' 'in your mailer, you should choose this answer.', 'No, I need to use an SMTP Host or I don\'t know if I have an MTA.', - (not options.smtphost)) + (not options.smtphost) if options.smtphost else False) if stupidmode: opts = [] @@ -2038,7 +2037,7 @@ # we get the return code of the script, headers and pseudo- set # by the script, and last the text output of the script - (rc, bugscript_hdrs, bugscript_pseudo, text) = \ + (rc, bugscript_hdrs, bugscript_pseudo, text, bugscript_attachments) = \ utils.exec_and_parse_bugscript(handler, bugexec) if rc and not notatty: @@ -2054,6 +2053,10 @@ headers.extend(bugscript_hdrs.split('\n')) if bugscript_pseudo: pseudos.append(bugscript_pseudo.strip()) + # add attachments only if no MUA is used, using attachments with a + # MUA is not yet supported by reportbug. + if bugscript_attachments and not mua: + attachments += bugscript_attachments addinfo = None if not self.options.noconf: addinfo = u"\n-- Package-specific info:\n"+text diff -Nru reportbug-6.4.4ubuntu1/debian/changelog reportbug-6.5.0ubuntu1/debian/changelog --- reportbug-6.4.4ubuntu1/debian/changelog 2013-03-19 00:32:16.000000000 +0000 +++ reportbug-6.5.0ubuntu1/debian/changelog 2014-01-28 19:02:19.000000000 +0000 @@ -1,3 +1,49 @@ +reportbug (6.5.0ubuntu1) trusty; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - bin/reportbug: If bts=ubuntu or unconfigured, exit with an + an error and refer user "ubuntu-bug" instead. + - reportbug/__init__.py: Match reportbug version with package version. + - debian/control: Add prominent note to package description. + - debian/rules, debian/dirs: Do not install .desktop file. + + -- Logan Rosen Tue, 28 Jan 2014 14:01:57 -0500 + +reportbug (6.5.0) unstable; urgency=low + + [ Sandro Tosi ] + * bin/reportbug + - changed to "No" the default to local MTA question in configuration mode; + thanks to Hartmut Bruening for the report; Closes: #732789 + * reportbug/debbugs.py + - improve the ITP template to ask for more information; thanks to Lucas + Nussbaum for the report and patch; Closes: #719067 + * bin/reportbug, reportbug/utils.py, doc/README.developers + - implement support for attachments in bugscripts; thanks to Joachim + Breitner for the report and to Michael Stapelberg for the patch; + Closes: #526110 + * reportbug/utils.py + - improve the template provided to less-expert reporters to be clear the + questions should be answered by the reporter themselves; thanks to Tony + Houghton for the report; Closes: #690782 + - match 'Description-en' too when getting package description + * reportbug/checkversions.py + - if NEW has several versions of the given package, choose the bigger; + thanks to Thorsten Glaser for the report; Closes: #704040 + * debian/control + - use canonical URL for Alioth service + - bump Standards-Version to 3.9.5 (no changes needed) + * debian/copyright + - extend copyright years + + [ Julien Cristau ] + * Update codename/suite mapping for wheezy release + * test: don't assert that unstable version is strictly greater than stable + * checkversions: let rmadison do the architecture/suite filtering + * debbugs: retire the opu tag for release.debian.org; Closes: #707631 + + -- Sandro Tosi Sun, 26 Jan 2014 20:40:56 +0100 + reportbug (6.4.4ubuntu1) raring; urgency=low * Merge from Debian unstable. Remaining changes: diff -Nru reportbug-6.4.4ubuntu1/debian/control reportbug-6.5.0ubuntu1/debian/control --- reportbug-6.4.4ubuntu1/debian/control 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/debian/control 2014-01-28 19:01:38.000000000 +0000 @@ -4,12 +4,12 @@ Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Reportbug Maintainers Uploaders: Sandro Tosi , Chris Lawrence -Standards-Version: 3.9.3 +Standards-Version: 3.9.5 Build-Depends: debhelper (>= 7), python (>= 2.5) Build-Depends-Indep: python-support, python-nose, python-setuptools, python-mock X-Python-Version: >= 2.6 -Vcs-Git: git://git.debian.org/git/reportbug/reportbug.git -Vcs-Browser: http://git.debian.org/?p=reportbug/reportbug.git +Vcs-Git: git://anonscm.debian.org/reportbug/reportbug.git +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=reportbug/reportbug.git Homepage: http://alioth.debian.org/projects/reportbug/ Package: reportbug diff -Nru reportbug-6.4.4ubuntu1/debian/copyright reportbug-6.5.0ubuntu1/debian/copyright --- reportbug-6.4.4ubuntu1/debian/copyright 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/debian/copyright 2014-01-28 19:01:38.000000000 +0000 @@ -8,7 +8,7 @@ Files: * Copyright: © 1999-2006 Chris Lawrence - Copyright (C) 2008-2012 Sandro Tosi + Copyright (C) 2008-2014 Sandro Tosi License: other # This program is freely distributable per the following license: # diff -Nru reportbug-6.4.4ubuntu1/doc/README.developers reportbug-6.5.0ubuntu1/doc/README.developers --- reportbug-6.4.4ubuntu1/doc/README.developers 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/doc/README.developers 2014-01-28 19:01:38.000000000 +0000 @@ -142,6 +142,19 @@ those headers are added to the ones already presente so a header with the same name will appear twice, since it won't replace the existing one. +Add attachments from the bugscript +================================== + +Similarly to headers and pseudo-headers, it's possible to add an attachment +from the bugscript using this syntax: + + -- BEGIN ATTACHMENTS -- + /path/to/the/file/to/attach + -- END ATTACHMENTS -- + +and that will attach the mentioned files to the bug report (if that's allowed, +in particular with not using a MUA but the internal reportbug mail facility). + Source layout ============= diff -Nru reportbug-6.4.4ubuntu1/reportbug/__init__.py reportbug-6.5.0ubuntu1/reportbug/__init__.py --- reportbug-6.4.4ubuntu1/reportbug/__init__.py 2013-03-19 00:29:44.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/__init__.py 2014-01-28 19:01:54.000000000 +0000 @@ -3,7 +3,7 @@ # reportbug - Report a bug in the Debian distribution. # Written by Chris Lawrence # Copyright (C) 1999-2008 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # @@ -25,8 +25,8 @@ __all__ = ['bugreport', 'utils', 'urlutils', 'checkbuildd', 'checkversions', 'debbugs', 'exceptions', 'submit', 'tempfile'] -VERSION_NUMBER = "6.4.4ubuntu1" +VERSION_NUMBER = "6.5.0ubuntu1" VERSION = "reportbug "+VERSION_NUMBER COPYRIGHT = VERSION + '\nCopyright (C) 1999-2008 Chris Lawrence ' + \ - '\nCopyright (C) 2008-2012 Sandro Tosi ' + '\nCopyright (C) 2008-2014 Sandro Tosi ' diff -Nru reportbug-6.4.4ubuntu1/reportbug/bugreport.py reportbug-6.5.0ubuntu1/reportbug/bugreport.py --- reportbug-6.4.4ubuntu1/reportbug/bugreport.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/bugreport.py 2014-01-28 19:01:38.000000000 +0000 @@ -2,7 +2,7 @@ # bugreport module - object containing bug stuff for reporting # Written by Chris Lawrence # Copyright (C) 1999-2008 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # diff -Nru reportbug-6.4.4ubuntu1/reportbug/checkbuildd.py reportbug-6.5.0ubuntu1/reportbug/checkbuildd.py --- reportbug-6.4.4ubuntu1/reportbug/checkbuildd.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/checkbuildd.py 2014-01-28 19:01:38.000000000 +0000 @@ -3,7 +3,7 @@ # # Written by Chris Lawrence # (C) 2002-08 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # diff -Nru reportbug-6.4.4ubuntu1/reportbug/checkversions.py reportbug-6.5.0ubuntu1/reportbug/checkversions.py --- reportbug-6.4.4ubuntu1/reportbug/checkversions.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/checkversions.py 2014-01-28 19:01:38.000000000 +0000 @@ -3,7 +3,7 @@ # # Written by Chris Lawrence # (C) 2002-08 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # @@ -104,8 +104,15 @@ if not dists: dists = ('oldstable', 'stable', 'testing', 'unstable', 'experimental') + arch = utils.get_arch() + + url = RMADISON_URL % package + url += '&s=' + ','.join(dists) + # select only those lines that refers to source pkg + # or to binary packages available on the current arch + url += '&a=source,all,' + arch try: - page = open_url(RMADISON_URL % package) + page = open_url(url) except NoNetwork: return {} except urllib2.HTTPError, x: @@ -118,7 +125,6 @@ content = page.read().replace(' ', '').strip() page.close() - arch = utils.get_arch() versions = {} for line in content.split('\n'): l = line.split('|') @@ -126,13 +132,8 @@ if len(l) != 4: continue # map suites name (returned by madison) to dist name - dist = utils.SUITES2DISTS.get(l[2], '') - if dist in dists: - # select only those lines that refers to source pkg - # or to binary packages available on the current arch - if 'source' in l[3].split(',') or arch in l[3].split(',') or \ - l[3] == 'all': - versions[dist] = l[1] + dist = utils.SUITES2DISTS.get(l[2], l[2]) + versions[dist] = l[1] return versions @@ -155,7 +156,8 @@ for para in Deb822.iter_paragraphs(page): if para['Source'] == package: k = para['Distribution'] + ' (' + para['Queue'] + ')' - versions[k] = para['Version'] + # in case of multiple versions, choose the bigger + versions[k] = max(para['Version'].split()) return versions diff -Nru reportbug-6.4.4ubuntu1/reportbug/debbugs.py reportbug-6.5.0ubuntu1/reportbug/debbugs.py --- reportbug-6.4.4ubuntu1/reportbug/debbugs.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/debbugs.py 2014-01-28 19:01:38.000000000 +0000 @@ -3,7 +3,7 @@ # # Written by Chris Lawrence # (C) 1999-2008 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # @@ -401,8 +401,8 @@ 'britney': "testing migration script bugs", 'transition': "transition tracking", 'unblock': "unblock requests", - 'opu': "oldstable proposed updates requests", - 'pu': "stable proposed updates requests", + 'squeeze-pu': "squeeze proposed updates requests", + 'wheezy-pu': "wheezy proposed updates requests", 'rm': "Stable/Testing removal requests", 'other' : "None of the other options", }, 'Choose the request type: ', empty_ok=True) @@ -447,14 +447,14 @@ else: package = info[12] or package - if tag in ('binnmu', 'unblock', 'opu', 'pu', 'rm'): - # FIXME: opu/pu/rm should lookup the version elsewhere + if tag in ('binnmu', 'unblock', 'wheezy-pu', 'squeeze-pu', 'rm'): + # FIXME: pu/rm should lookup the version elsewhere version = info and info[0] if online: - if tag == 'pu': - version = checkversions.get_versions_available(package, timeout).get('stable', '') - elif tag == 'opu': - version = checkversions.get_versions_available(package, timeout).get('oldstable', '') + if tag == 'wheezy-pu': + version = checkversions.get_versions_available(package, timeout, 'wheezy').values()[0] + elif tag == 'squeeze-pu': + version = checkversions.get_versions_available(package, timeout, 'squeeze').values()[0] if version: cont = ui.select_options( "Latest version seems to be %s, is this the proper one ?" % (version), @@ -487,7 +487,11 @@ ui.long_message('No architecture specified, skipping...') pseudos.append("User: release.debian.org@packages.debian.org") - pseudos.append("Usertags: %s" % (tag)) + if tag.endswith('-pu'): + pseudos.append("Usertags: pu") + pseudos.append("Tags: %s" % (tag[:-3])) + else: + pseudos.append("Usertags: %s" % (tag)) if tag == 'binnmu': reason = ui.get_string("binNMU changelog entry: ") @@ -558,7 +562,7 @@ unblock %s/%s """ % (package, package, version)) - elif tag == 'pu' or tag == 'opu': + elif tag.endswith('-pu'): subject = '%s: package %s/%s' % (tag, package, version) body = '(please explain the reason for this update here)\n' elif tag == 'rm': @@ -577,6 +581,15 @@ Description : %(short_desc)s (Include the long description here.) + + Please also include as much relevant information as possible. + For example, consider answering the following questions: + - why is this package useful/relevant? is it a dependency for + another package? do you use it? if there are other packages + providing similar functionality, how does it compare? + - how do you plan to maintain it? inside a packaging team + (check list at https://wiki.debian.org/Teams)? are you + looking for co-maintainers? do you need a sponsor? """) diff -Nru reportbug-6.4.4ubuntu1/reportbug/exceptions.py reportbug-6.5.0ubuntu1/reportbug/exceptions.py --- reportbug-6.4.4ubuntu1/reportbug/exceptions.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/exceptions.py 2014-01-28 19:01:38.000000000 +0000 @@ -1,7 +1,7 @@ # Exceptions for reportbug # Written by Chris Lawrence # (C) 2002-04 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # diff -Nru reportbug-6.4.4ubuntu1/reportbug/hiermatch.py reportbug-6.5.0ubuntu1/reportbug/hiermatch.py --- reportbug-6.4.4ubuntu1/reportbug/hiermatch.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/hiermatch.py 2014-01-28 19:01:38.000000000 +0000 @@ -1,7 +1,7 @@ # hiermatch - Doing match on a list of string or a hierarchy. # Written by Chris Lawrence # Copyright (C) 1999-2008 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi import re import exceptions diff -Nru reportbug-6.4.4ubuntu1/reportbug/submit.py reportbug-6.5.0ubuntu1/reportbug/submit.py --- reportbug-6.4.4ubuntu1/reportbug/submit.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/submit.py 2014-01-28 19:01:38.000000000 +0000 @@ -1,7 +1,7 @@ # reportbug_submit module - email and GnuPG functions # Written by Chris Lawrence # Copyright (C) 1999-2006 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # diff -Nru reportbug-6.4.4ubuntu1/reportbug/tempfiles.py reportbug-6.5.0ubuntu1/reportbug/tempfiles.py --- reportbug-6.4.4ubuntu1/reportbug/tempfiles.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/tempfiles.py 2014-01-28 19:01:38.000000000 +0000 @@ -2,7 +2,7 @@ # tempfiles module - Temporary file handling for reportbug # Written by Chris Lawrence # (C) 1999-2008 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # diff -Nru reportbug-6.4.4ubuntu1/reportbug/ui/__init__.py reportbug-6.5.0ubuntu1/reportbug/ui/__init__.py --- reportbug-6.4.4ubuntu1/reportbug/ui/__init__.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/ui/__init__.py 2014-01-28 19:01:38.000000000 +0000 @@ -3,7 +3,7 @@ # reportbug - Report a bug in the Debian distribution. # Written by Chris Lawrence # Copyright (C) 1999-2008 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # diff -Nru reportbug-6.4.4ubuntu1/reportbug/ui/text_ui.py reportbug-6.5.0ubuntu1/reportbug/ui/text_ui.py --- reportbug-6.4.4ubuntu1/reportbug/ui/text_ui.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/ui/text_ui.py 2014-01-28 19:01:38.000000000 +0000 @@ -1,7 +1,7 @@ # Text user interface for reportbug # Written by Chris Lawrence # (C) 2001-08 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # diff -Nru reportbug-6.4.4ubuntu1/reportbug/ui/urwid_ui.py reportbug-6.5.0ubuntu1/reportbug/ui/urwid_ui.py --- reportbug-6.4.4ubuntu1/reportbug/ui/urwid_ui.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/ui/urwid_ui.py 2014-01-28 19:01:38.000000000 +0000 @@ -1,7 +1,7 @@ # urwid user interface for reportbug # Written by Chris Lawrence # (C) 2006-08 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # diff -Nru reportbug-6.4.4ubuntu1/reportbug/urlutils.py reportbug-6.5.0ubuntu1/reportbug/urlutils.py --- reportbug-6.4.4ubuntu1/reportbug/urlutils.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/urlutils.py 2014-01-28 19:01:38.000000000 +0000 @@ -3,7 +3,7 @@ # # Written by Chris Lawrence # (C) 1999-2008 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # diff -Nru reportbug-6.4.4ubuntu1/reportbug/utils.py reportbug-6.5.0ubuntu1/reportbug/utils.py --- reportbug-6.4.4ubuntu1/reportbug/utils.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/reportbug/utils.py 2014-01-28 19:01:38.000000000 +0000 @@ -2,7 +2,7 @@ # utils module - common functions for reportbug UIs # Written by Chris Lawrence # Copyright (C) 1999-2008 Chris Lawrence -# Copyright (C) 2008-2012 Sandro Tosi +# Copyright (C) 2008-2014 Sandro Tosi # # This program is freely distributable per the following license: # @@ -74,7 +74,8 @@ from reportbug.ui import AVAILABLE_UIS NEWBIELINE = """Dear Maintainer, -*** Please consider answering these questions, where appropriate *** + +*** Reporter, please consider answering these questions, where appropriate *** * What led up to the situation? * What exactly did you do (or not do) that was effective (or @@ -82,15 +83,15 @@ * What was the outcome of this action? * What outcome did you expect instead? -*** End of the template - remove these lines ***""" +*** End of the template - remove these template lines ***""" fhs_directories = ['/', '/usr', '/usr/share', '/var', '/usr/X11R6', '/usr/man', '/usr/doc', '/usr/bin'] # A map between suites and distributions names -SUITES2DISTS = {'lenny': 'oldstable', - 'squeeze': 'stable', - 'wheezy': 'testing', +SUITES2DISTS = {'squeeze': 'oldstable', + 'wheezy': 'stable', + 'jessie': 'testing', 'sid': 'unstable', 'experimental': 'experimental'} @@ -497,7 +498,7 @@ def available_package_description(package): data = commands.getoutput('apt-cache show'+commands.mkarg(package)) data = data.decode('utf-8', 'replace') - descre = re.compile(r'^Description: (.*)$') + descre = re.compile(r'^Description(?:-en): (.*)$') for line in data.split('\n'): m = descre.match(line) if m: @@ -1181,7 +1182,9 @@ isheaders = False ispseudoheaders = False + isattachments = False headers = pseudoheaders = text = '' + attachments = [] fp = open(filename) for line in fp.readlines(): # we identify the blocks for headers and pseudo-h @@ -1193,15 +1196,21 @@ ispseudoheaders = True elif line == '-- END PSEUDOHEADERS --\n': ispseudoheaders = False + elif line == '-- BEGIN ATTACHMENTS --\n': + isattachments = True + elif line == '-- END ATTACHMENTS --\n': + isattachments = False else: if isheaders: headers += line elif ispseudoheaders: pseudoheaders += line + elif isattachments: + attachments.append(line.strip()) else: text += line fp.close() cleanup_temp_file(filename) text = text.decode('utf-8', 'replace') - return (rc, headers, pseudoheaders, text) + return (rc, headers, pseudoheaders, text, attachments) diff -Nru reportbug-6.4.4ubuntu1/test/data/bugscript reportbug-6.5.0ubuntu1/test/data/bugscript --- reportbug-6.4.4ubuntu1/test/data/bugscript 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/test/data/bugscript 2014-01-28 19:01:38.000000000 +0000 @@ -16,4 +16,7 @@ echo "-- BEGIN HEADERS --" echo "X-Test: this is a test" echo "X-Dummy-Reportbug-Header: dummy" -echo "-- END HEADERS --" \ No newline at end of file +echo "-- END HEADERS --" +echo "-- BEGIN ATTACHMENTS --" +echo "/etc/fstab" +echo "-- END ATTACHMENTS --" diff -Nru reportbug-6.4.4ubuntu1/test/test_checkversions.py reportbug-6.5.0ubuntu1/test/test_checkversions.py --- reportbug-6.4.4ubuntu1/test/test_checkversions.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/test/test_checkversions.py 2014-01-28 19:01:38.000000000 +0000 @@ -3,6 +3,8 @@ from reportbug import checkversions from nose.plugins.attrib import attr +import mock + class TestCheckversions(unittest2.TestCase): def test_compare_versions(self): @@ -31,6 +33,42 @@ self.assertEqual(checkversions.later_version('1.2.4', '1.2.3'), '1.2.4') +class TestNewQueue(unittest2.TestCase): + + def test_bts704040(self): + + # return an iterable object, so that Deb822 (what parses the result) + # will work + pkg_in_new = """Source: procps +Binary: libprocps1-dev, procps, libprocps1 +Version: 1:3.3.6-2 1:3.3.6-1 1:3.3.7-1 1:3.3.5-1 +Architectures: source, amd64 +Age: 4 months +Last-Modified: 1353190660 +Queue: new +Maintainer: Craig Small +Changed-By: Craig Small +Distribution: experimental +Fingerprint: 5D2FB320B825D93904D205193938F96BDF50FEA5 +Closes: #682082, #682083, #682086, #698482, #699716 +Changes-File: procps_3.3.6-1_amd64.changes + +Source: aaa +""".split('\n') + + # save the original checkversions.open_url() method + save_open_url = checkversions.open_url + + checkversions.open_url = mock.MagicMock(return_value = pkg_in_new) + + res = checkversions.get_newqueue_available('procps', 60) + + self.assertEqual(res.keys()[0], u'experimental (new)') + self.assertEqual(res[u'experimental (new)'], u'1:3.3.7-1') + + # restore the original checkversions.open_url() method + checkversions.open_url = save_open_url + class TestVersionAvailable(unittest2.TestCase): @attr('network') #marking the test as using network @@ -38,7 +76,7 @@ vers = checkversions.get_versions_available('reportbug', 60) # check stable version is lower than unstable chk = checkversions.compare_versions(vers['stable'], vers['unstable']) - self.assertEqual(chk, 1) + self.assertGreaterEqual(chk, 0) @attr('network') #marking the test as using network def test_bts649649(self): @@ -52,3 +90,9 @@ # squeeze (stable at this time) is the first suite where texlive-xetex # is arch:all self.assertIn('stable', vers) + + @attr('network') + def test_codenames(self): + vers = checkversions.get_versions_available('reportbug', 60, ['sid']) + self.assertEqual(1, len(vers)) + self.assertEqual(vers.keys()[0], 'unstable') diff -Nru reportbug-6.4.4ubuntu1/test/test_utils.py reportbug-6.5.0ubuntu1/test/test_utils.py --- reportbug-6.4.4ubuntu1/test/test_utils.py 2013-03-19 00:28:51.000000000 +0000 +++ reportbug-6.5.0ubuntu1/test/test_utils.py 2014-01-28 19:01:38.000000000 +0000 @@ -576,9 +576,10 @@ handler = os.path.dirname(__file__) + '/../share/handle_bugscript' bugscript_file = os.path.dirname(__file__) + '/data/bugscript' - (rc, h, ph, t) = utils.exec_and_parse_bugscript(handler, bugscript_file) + (rc, h, ph, t, a) = utils.exec_and_parse_bugscript(handler, bugscript_file) self.assertIn('python', t) self.assertIn('debian', t) self.assertIn('From: morph@dummy.int', h) self.assertIn('User: morph@debian.org', ph) + self.assertIn('/etc/fstab', a)