Browse Source

Add changes from reportbug 3.39-0.1

tags/3.40
Chris Lawrence 13 years ago
parent
commit
8421598c56
12 changed files with 556 additions and 368 deletions
  1. +16
    -0
      debian/changelog
  2. +1
    -1
      debian/control
  3. +153
    -58
      debianbts.py
  4. +171
    -150
      po4a/po/fr.po
  5. +163
    -145
      po4a/po/reportbug.pot
  6. +3
    -1
      querybts
  7. +19
    -4
      reportbug
  8. +12
    -1
      reportbug.1
  9. +3
    -0
      reportbug.conf
  10. +9
    -3
      reportbug.conf.5
  11. +2
    -2
      reportbug.py
  12. +4
    -3
      reportbug_ui_text.py

+ 16
- 0
debian/changelog View File

@@ -1,3 +1,19 @@
reportbug (3.39-0.1) unstable; urgency=low

* Non-maintainer upload
* Add templates for ftp.debian.org removal (RM) requests (Closes: #459333)
* Add a -P option to allow setting pseudo-headers, useful for setting
usertags. Thanks Lucas Nussbaum <lucas@lucas-nussbaum.net> for the patch
(Closes: #445144)
* Raise an error and indicate to the user in case of any network errors
(Closes: #302103)
* CC: secure-testing-team@lists.alioth.debian.org when a security issue is
reported (Closes: #448874)
* Indicate that in mode > standard incoming and NEW are also checked with
--check-available (Closes: #450523, #447380)

-- Y Giridhar Appaji Nag <giridhar@appaji.net> Sat, 22 Mar 2008 15:33:23 +0530

reportbug (3.39) unstable; urgency=low

* Add man page for reportbug.conf, thanks to Y Giridhar Appaji Nag.


+ 1
- 1
debian/control View File

@@ -9,7 +9,7 @@ XS-Python-Version: current, >= 2.4

Package: reportbug
Architecture: all
Depends: ${python:Depends}, apt, python-btsutils
Depends: ${python:Depends}, apt
Suggests: postfix | exim4 | mail-transport-agent, gnupg | pgp, debconf-utils (>> 1.1.0), debsums, file (>> 1.30), dlocate, python-urwid
Conflicts: python-urwid (<< 0.9.8-1), python-central (= 0.5.13)
XB-Python-Version: ${python:Versions}


+ 153
- 58
debianbts.py View File

@@ -1,7 +1,8 @@
#
# debianbts.py - Routines to deal with the debbugs web pages
#
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 1999-2007 Chris Lawrence
# (C) 1999-2006 Chris Lawrence
#
# This program is freely distributable per the following license:
#
@@ -21,9 +22,10 @@
#
# Version ##VERSION##; see changelog for revision history
#
# $Id: debianbts.py,v 1.24.2.14 2007-09-04 04:08:44 lawrencc Exp $
# $Id: debianbts.py,v 1.24.2.15 2008-04-18 05:38:27 lawrencc Exp $

import sgmllib, glob, os, re, reportbug, rfc822, time, urllib, checkversions
from reportbug_exceptions import *
from urlutils import open_url
import sys

@@ -33,8 +35,6 @@ import email.Errors
import cStringIO
import cgi

from btsutils.debbugs import debbugs

def msgfactory(fp):
try:
return email.message_from_file(fp)
@@ -156,7 +156,7 @@ debother = {
'cdrom' : 'Problems with installation from CD-ROMs',
# dpkg-iwj -- The dpkg branch maintained by Ian Jackson
'debian-policy' : 'Proposed changes in the Debian policy documentation',
'ftp.debian.org' : 'Problems with the FTP site',
'ftp.debian.org' : 'Problems with the FTP site and Package removal requests',
'general' : 'General problems (e.g., that many manpages are mode 755)',
# 'install' : 'Problems with the sarge installer.',
# 'installation' : 'General installation problems not covered otherwise.',
@@ -183,6 +183,125 @@ progenyother = {
'debian-general' : 'Any non-package-specific bug',
}

def handle_debian_ftp(package, bts, ui, fromaddr, online=True, http_proxy=None):
body = reason = archs = ''
suite = 'unstable'
headers = []
pseudos = []
query = True
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.)', {
'ROM' :
"Package removal - Request Of Maintainer.",
'RoQA' :
"Package removal - Requested by the QA team.",
'ROP' :
"Package removal - Request of Porter.",
'ROSRM' :
"Package removal - Request of Stable Release Manager.",
'NBS' :
"Package removal - Not Built [by] Source.",
'NPOASR' :
"Package removal - Never Part Of A Stable Release.",
'NVIU' :
"Package removal - Newer Version In Unstable.",
'ANAIS' :
"Package removal - Architecture Not Allowed In Source.",
'ICE' :
"Package removal - Internal Compiler Error.",
'[cruft-report]' :
"Package removal - detected by the cruft finder script.",
'other' :
"Not a package removal request, report other problems.",
}, '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 ftp.debian.org.\n')
raise SystemExit

severity = 'normal'
if tag == 'other':
return
else:
prompt = 'Please enter the name of the package: '
package = ui.get_string(prompt)
if not package:
ui.ewrite('You seem to want to report a generic bug, not request a removal\n')
return

ui.ewrite('Checking status database...\n')
info = reportbug.get_package_status(package)
available = info[1]

query = False
if not available:
info = reportbug.get_source_package(package)
if info:
info = reportbug.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

suite = ui.menu('Is the removal to be done in a suite other than'
' "unstable"? Please press Enter for "unstable"', {
'oldstable' : "Old stable.",
'oldstable-proposed-updates' : "Old stable proposed updates.",
'stable' : "Stable.",
'stable-proposed-updates' : "Stable proposed updates.",
'testing' : "Testing",
'testing-proposed-updates' : "Testing proposed updates",
'experimental' : "Experimental.",
}, 'Choose the suite: ', empty_ok=True)
if not suite:
suite = 'unstable'

if suite not in ('testing', 'unstable', 'experimental'):
headers.append('X-Debbugs-CC: debian-release@lists.debian.org')
ui.ewrite('Your report will be carbon-copied to debian-release.\n')

why = 'Please enter the reason for removal: '
reason = ui.get_string(why)
if not reason: return

partial = ui.select_options(
"Is this removal 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

if archs:
if suite != 'unstable':
subject = 'RM: %s/%s [%s] -- %s; %s' % (package, suite, archs, tag, reason)
else:
subject = 'RM: %s [%s] -- %s; %s' % (package, archs, tag, reason)
else:
if suite != 'unstable':
subject = 'RM: %s/%s -- %s; %s' % (package, suite, tag, reason)
else:
subject = 'RM: %s -- %s; %s' % (package, tag, reason)

if suite == 'testing':
ui.ewrite('Please use the following subject and send a mail to '
'debian-release@lists.debian.org to request removal.\n')
ui.ewrite(subject)
sys.exit(1)

return (subject, severity, headers, pseudos, body, query)

def handle_wnpp(package, bts, ui, fromaddr, online=True, http_proxy=None):
desc = body = ''
headers = []
@@ -311,7 +430,9 @@ SYSTEMS = { 'debian' :
'btsroot' : 'http://www.debian.org/Bugs/',
'otherpkgs' : debother,
'nonvirtual' : ['linux-image', 'kernel-image'],
'specials' : { 'wnpp': handle_wnpp },
'specials' :
{ 'wnpp': handle_wnpp,
'ftp.debian.org': handle_debian_ftp },
# Dependency packages
'deppkgs' : ('gcc', 'g++', 'cpp', 'gcj', 'gpc', 'gobjc',
'chill', 'gij', 'g77', 'python', 'python-base',
@@ -323,6 +444,15 @@ SYSTEMS = { 'debian' :
'mandrake' :
{ 'name' : 'Linux-Mandrake', 'email': '%s@bugs.linux-mandrake.com',
'type' : 'mailto', 'query-dpkg' : False },
'gnome' :
{ 'name' : 'GNOME Project', 'email': '%s@bugs.gnome.org',
'type' : 'mailto', 'query-dpkg' : False },
'ximian' :
{ 'name' : 'Ximian', 'email': '%s@bugs.ximian.com',
'type' : 'mailto' },
'progeny' :
{ 'name' : 'Progeny', 'email' : 'bugs@progeny.com',
'type' : 'gnats', 'otherpkgs' : progenyother },
'ubuntu' :
{ 'name' : 'Ubuntu', 'email' : 'ubuntu-users@lists.ubuntu.com',
'type' : 'mailto' },
@@ -335,6 +465,8 @@ SYSTEMS = { 'debian' :
'cgiroot' : 'http://bugs.grml.org/cgi-bin/' },
}

SYSTEMS['helixcode'] = SYSTEMS['ximian']

CLASSES = {
'sw-bug' : 'The problem is a bug in the software or code. For'
'example, a crash would be a sw-bug.',
@@ -753,8 +885,12 @@ def parse_mbox_report(number, url, http_proxy, followups=False):

def get_cgi_reports(package, system='debian', http_proxy='', archived=False,
source=False, version=None):
page = open_url(cgi_package_url(system, package, archived, source,
try:
page = open_url(cgi_package_url(system, package, archived, source,
version=version), http_proxy)
except:
raise NoNetwork

if not page:
return (0, None, None)

@@ -799,17 +935,19 @@ def get_btsroot(system, mirrors=None):
def get_reports(package, system='debian', mirrors=None, version=None,
http_proxy='', archived=False, source=False):
if isinstance(package, basestring):
if system == 'debian':
result = debbugs_query(package, source=False)
if result: return result
if SYSTEMS[system].get('cgiroot'):
result = get_cgi_reports(package, system, http_proxy, archived,
try:
result = get_cgi_reports(package, system, http_proxy, archived,
source, version=version)
except:
raise NoNetwork
if result: return result

url = package_url(system, package, mirrors, source)
page = open_url(url, http_proxy)
try:
page = open_url(url, http_proxy)
except:
raise NoNetwork
if not page:
return (0, None, None)

@@ -848,15 +986,7 @@ def get_reports(package, system='debian', mirrors=None, version=None,

def get_report(number, system='debian', mirrors=None,
http_proxy='', archived=False, followups=False):
try:
number = int(number)
except ValueError:
return None
if system == 'debian':
result = debbugs_get(number, source=False)
if result: return result

number = int(number)
if SYSTEMS[system].get('cgiroot'):
result = get_cgi_report(number, system, http_proxy, archived,
followups)
@@ -871,44 +1001,9 @@ class NullParser(sgmllib.SGMLParser):
def __init__(self):
sgmllib.SGMLParser.__init__(self)

## Tools for using the python-btsutils package
## Still needs version support to be useful, alas...
def debbugs_query(querystr, source=False):
if 1:
return None
bts = debbugs()
if source:
q = 'src:'+querystr
else:
q = 'pkg:'+querystr

try:
bugs = bts.query(q)
except:
return None

print bugs
# Transform to format used elsewhere in reportbug
return bugstruct

def debbugs_get(number):
bts = debbugs()
try:
bug = bts.get(number)
except:
return get_cgi_report(number)
#print bug
cgirep = get_cgi_report(number)

return (cgirep[0], [str(bug)]+cgirep[1])

if __name__ == '__main__':
import pprint

#data = get_reports('reportbug')
#data = debbugs_get(400000)
data = debbugs_query('reportbug')
data = get_cgi_reports('reportbug')
pprint.pprint(data)
time.sleep(1000)

+ 171
- 150
po4a/po/fr.po
File diff suppressed because it is too large
View File


+ 163
- 145
po4a/po/reportbug.pot
File diff suppressed because it is too large
View File


+ 3
- 1
querybts View File

@@ -22,7 +22,7 @@
#
# Version ##VERSION##; see changelog for revision history
#
# $Id: querybts,v 1.7.2.2 2006-08-26 02:00:27 lawrencc Exp $
# $Id: querybts,v 1.7.2.3 2008-04-18 05:38:27 lawrencc Exp $

import sys, os
sys.path = [os.curdir, '/usr/share/reportbug'] + sys.path
@@ -205,6 +205,8 @@ def main():
ui.long_message('No bug reports found.\n')
except NoReport:
ui.long_message('Nothing new to report; exiting.\n')
except NoNetwork:
ui.long_message('Cannot connect to network.\n')

if __name__ == '__main__':
try:


+ 19
- 4
reportbug View File

@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE."""
#
# Version ##VERSION##; see changelog for revision history
# $Id: reportbug,v 1.98.2.32 2007-08-16 22:40:37 lawrencc Exp $
# $Id: reportbug,v 1.98.2.33 2008-04-18 05:38:27 lawrencc Exp $

# Work around case where Python install might be broken (#290043)
try:
@@ -344,6 +344,14 @@ def get_package_name(bts='debian', mode=MODE_EXPERT):
False):
return get_package_name(bts, mode)

if package == 'ftp.debian.org':
if not ui.yes_no(
'Are you sure you want to file a bug on ftp.debian.org?',
'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.',
False):
return get_package_name(bts, mode)

return package

def special_prompts(package, bts, ui, fromaddr):
@@ -620,6 +628,8 @@ def main():
help="key ID to use for PGP/GnuPG signatures")
parser.add_option('-H', '--header', action='append', dest='headers',
help='add a custom RFC822 header to your report')
parser.add_option('-P', '--pseudo-header', action='append', dest='pseudos',
help='add a custom pseudo-header to your report')
parser.add_option('--license', action='store_true', default=False,
help='show copyright and license information')
parser.add_option('-m', '--maintonly', action='store_const',
@@ -823,6 +833,7 @@ class UI(object):
check_available = self.options.check_available
dontquery = self.options.dontquery
headers = self.options.headers or []
pseudos = self.options.pseudos or []
mua = self.options.mua
pkgversion = self.options.pkgversion
quietly = self.options.quietly
@@ -1218,9 +1229,13 @@ class UI(object):
'(blank OK)', force_prompt=True)
elif (check_available and not (self.options.kudos or notatty or self.options.offline)
and state == 'installed' and bts == 'debian'):
ewrite('Checking for newer versions at packages.debian.org...\n')
arch = reportbug.get_arch()
check_more = (mode > MODE_STANDARD)
if check_more:
ewrite('Checking for newer versions at packages.debian.org,'+
' incoming.debian.org and http://ftp-master.debian.org/new.html\n')
else:
ewrite('Checking for newer versions at packages.debian.org...\n')
(avail, toonew) = checkversions.check_available(
package, pkgversion, check_incoming=check_more,
check_newqueue=check_more,
@@ -1294,7 +1309,6 @@ class UI(object):
dontquery = True

special = False
pseudos = []
if not body and not subject and not notatty:
res = special_prompts(package, bts, ui, fromaddr)
if res:
@@ -1638,8 +1652,9 @@ orphaned for a long period of time are often removed from the archive.\n''')
incfiles = addinfo

if bts == 'debian' and 'security' in taglist:
ewrite('Will send a CC of this report to the Debian Security Team.\n')
ewrite('Will send a CC of this report to the Debian Security and Testing Security Team.\n')
listcc += ['Debian Security Team <team@security.debian.org>']
listcc += ['Debian Testing Security Team <secure-testing-team@lists.alioth.debian.org>']

if listcc:
headers.append('X-Debbugs-CC: '+', '.join(listcc))


+ 12
- 1
reportbug.1 View File

@@ -97,7 +97,10 @@ This will erase any pre-existing settings in the file; however, a
backup will be written as .reportbugrc~.
.TP
.B \-\-check\-available
Check for newer releases of the package at packages.debian.org (default).
Check for newer releases of the package at packages.debian.org
(default). In \fBadvanced\fP and \fBexpert\fP mode, check
\fBincoming.debian.org\fP and
\fBhttp://ftp-master.debian.org/new.html\fP.
.TP
.B \-\-no\-check\-available
Do not check for newer releases of the package at packages.debian.org.
@@ -306,6 +309,14 @@ behind a firewall. The PROXY argument should be formatted as a valid
HTTP URL, including (if necessary) a port number; for example,
\fBhttp://192.168.1.1:3128/\fP.
.TP
.B \-P PSEUDO-HEADER, \-\-pseudo\-header=PSEUDO-HEADER
Add a custom pseudo-header to your email; for example, to add the
.I mytag
usertag for the user
.I humberto@example.com
to the bug, you could use
.I \-P 'User: humberto@example.com' \-P 'Usertags: mytag'
.TP
.B \-q, \-\-quiet
Suppress diagnostic messages to standard error.
.TP


+ 3
- 0
reportbug.conf View File

@@ -32,6 +32,9 @@ submit
# Should I query the BTS?
query-bts

# Should I check for newer releases of the package
# check-available

# Should I CC the reporter?
cc



+ 9
- 3
reportbug.conf.5 View File

@@ -18,9 +18,9 @@
.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
.\" $Id: reportbug.conf.5,v 1.1.2.1 2007-08-16 22:41:06 lawrencc Exp $
.\" $Id: reportbug.conf.5,v 1.1.2.2 2008-04-18 05:38:28 lawrencc Exp $
.\"
.TH REPORTBUG.CONF 5 "Aug 2007" "reportbug 3.38"
.TH REPORTBUG.CONF 5 "Dec 2007" "reportbug 3.39"
.SH NAME
.B reportbug.conf
- The configuration file for reportbug
@@ -68,6 +68,12 @@ for a list of currently supported BTSes
.B cc (\fIboolean\fP)
Whether the reporter should be Cc:ed on the bug report
.TP
.B check-available (\fIboolean\fP)
Whether \fBpackages.debian.org\fP should be queried for newer releases
of the package. In \fBadvanced\fP and \fBexpert\fP mode,
\fBincoming.debian.org\fP and
\fBhttp://ftp-master.debian.org/new.html\fP are also checked.
.TP
.B compress (\fIboolean\fP)
Whether modified configuration files included in the bug report should
be stripped down
@@ -247,4 +253,4 @@ reportbug was written by Chris Lawrence <lawrencc@debian.org>
This manual page was written by Y Giridhar Appaji Nag
<giridhar@appaji.net> for the Debian project, but may be used by others.
.PP
Last modified: 2007-08-13 by Y Giridhar Appaji Nag
Last modified: 2007-12-20 by Y Giridhar Appaji Nag

+ 2
- 2
reportbug.py View File

@@ -21,7 +21,7 @@
#
# Version ##VERSION##; see changelog for revision history
#
# $Id: reportbug.py,v 1.35.2.23 2007-08-16 22:40:37 lawrencc Exp $
# $Id: reportbug.py,v 1.35.2.24 2008-04-18 05:38:28 lawrencc Exp $

VERSION = "reportbug ##VERSION##"
VERSION_NUMBER = "##VERSION##"
@@ -42,7 +42,7 @@ STATUSDB = os.path.join(DPKGLIB, 'status')

# Headers other than these become email headers for debbugs servers
PSEUDOHEADERS = ('Package', 'Version', 'Severity', 'File', 'Tags',
'Justification', 'Followup-For', 'Owner')
'Justification', 'Followup-For', 'Owner', 'User', 'Usertags')

VALID_UIS = ['newt', 'text', 'gnome2', 'urwid']
AVAILABLE_UIS = []


+ 4
- 3
reportbug_ui_text.py View File

@@ -18,7 +18,7 @@
## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
## SOFTWARE.
#
# $Id: reportbug_ui_text.py,v 1.19.2.8 2007-04-11 03:53:50 lawrencc Exp $
# $Id: reportbug_ui_text.py,v 1.19.2.9 2008-04-18 05:38:28 lawrencc Exp $

import commands, sys, os, re, math, string, debianbts, errno, reportbug
from reportbug_exceptions import *
@@ -505,8 +505,9 @@ def handle_bts_query(package, bts, mirrors=None, http_proxy="",
return browse_bugs(hierarchy, count, bugs, bts, queryonly,
mirrors, http_proxy, screen, title)

except IOError:
res = select_options('Unable to connect to BTS; continue', 'yN',
except (IOError, NoNetwork):
ewrite('Unable to connect to %s BTS; ', debianbts.SYSTEMS[bts]['name'])
res = select_options('continue', 'yN',
{'y': 'Keep going.',
'n': 'Abort.'})
if res == 'n':


Loading…
Cancel
Save