submittodebian: Check existing bug reports before editing anything.

This commit is contained in:
Stefano Rivera 2011-12-02 21:33:10 +02:00
parent 9c20cc13a3
commit ff9305976b
2 changed files with 28 additions and 5 deletions

1
debian/changelog vendored
View File

@ -18,6 +18,7 @@ ubuntu-dev-tools (0.137) UNRELEASED; urgency=low
* mk-sbuild, pbuilder-dist, ubuntu-build: Add armhf.
* pull-debian-source, pull-lp-source: Resolve the source package (via DDE),
if a binary package was requested (LP: #617349)
* submittodebian: Check existing bug reports before editing anything.
[ Andreas Moog ]
* sponsor-patch: Check permission to unsubscribe sponsors-team (LP: #896884)

View File

@ -30,7 +30,7 @@ from tempfile import mkdtemp
from distro_info import UbuntuDistroInfo
from ubuntutools.config import ubu_email
from ubuntutools.question import YesNoQuestion, EditFile
from ubuntutools.question import YesNoQuestion, EditFile, confirmation_prompt
from ubuntutools.subprocess import call, check_call, Popen, PIPE
try:
@ -118,12 +118,32 @@ def check_file(fname, critical = True):
def submit_bugreport(body, debdiff, deb_version, changelog):
devel = UbuntuDistroInfo().devel()
cmd = ('reportbug', '-P', 'User: ubuntu-devel@lists.ubuntu.com',
'-P', 'Usertags: origin-ubuntu %s ubuntu-patch' % devel,
'-T', 'patch', '-A', debdiff, '-B', 'debian', '-i', body,
'-V', deb_version, changelog.package)
cmd = ('reportbug',
'--no-check-available',
'--no-check-installed',
'--no-query-bts',
'--pseudo-header', 'User: ubuntu-devel@lists.ubuntu.com',
'--pseudo-header', 'Usertags: origin-ubuntu %s ubuntu-patch' % devel,
'--tag', 'patch',
'--attach', debdiff,
'--bts', 'debian',
'--include', body,
'--package-version', deb_version,
changelog.package)
check_call(cmd)
def check_existing_bugreports(package, deb_version):
print "Checking existing bug reports first."
print
cmd = ('reportbug',
'--no-check-available',
'--no-check-installed',
'--query-only',
'--bts', 'debian',
'--package-version', deb_version, package)
check_call(cmd)
confirmation_prompt(action='continue filing this bug')
def check_reportbug_config():
fn = os.path.expanduser('~/.reportbugrc')
if os.path.exists(fn):
@ -173,6 +193,8 @@ def main():
deb_version = get_most_recent_debian_version(changelog)
bug_body = get_bug_body(changelog)
check_existing_bugreports(changelog.package, deb_version)
tmpdir = mkdtemp()
body = os.path.join(tmpdir, 'bug_body')
fp = open(body, 'w')