bug fixes

This commit is contained in:
Michael Bienia 2009-08-25 13:02:57 +02:00
parent f284ee7cd6
commit 82899a0f45
4 changed files with 25 additions and 13 deletions

View File

@ -124,9 +124,13 @@ if __name__ == '__main__':
newsource = True
# Get the requested Debian source package
debian_srcpkg = getDebianSrcPkg(srcpkg, distro)
debian_version = Version(debian_srcpkg.getVersion())
debian_component = debian_srcpkg.getComponent()
try:
debian_srcpkg = getDebianSrcPkg(srcpkg, distro)
debian_version = Version(debian_srcpkg.getVersion())
debian_component = debian_srcpkg.getComponent()
except udtexceptions.PackageNotFoundException, e:
print >> sys.stderr, "E: %s" % e
sys.exit(1)
# Debian and Ubuntu versions are the same - stop
if ubuntu_version == debian_version:
@ -136,7 +140,7 @@ if __name__ == '__main__':
# -s flag not specified - check if we do need sponsorship
if not sponsorship:
sponsorship = needsSponsorship(srcpkg, ubuntu_component)
sponsorship = needSponsorship(srcpkg, ubuntu_component)
# Check for existing package reports
if not newsource:

View File

@ -34,7 +34,7 @@ def raw_input_exit_on_ctrlc(*args, **kwargs):
try:
return raw_input(*args, **kwargs)
except KeyboardInterrupt:
print 'Abort requested. No sync request filed.'
print '\nAbort requested. No sync request filed.'
sys.exit(1)
def getDebianChangelog(srcpkg, version):
@ -48,6 +48,9 @@ def getDebianChangelog(srcpkg, version):
subdir = 'lib%s' % pkgname[3]
else:
subdir = pkgname[0]
# Strip epoch from version
if ':' in pkgversion:
pkgversion = pkgversion[pkgversion.find(':')+1:]
# Get the debian changelog file from packages.debian.org
try:
@ -113,6 +116,8 @@ def edit_report(subject, body, changes_required = False):
print 'The report has not been changed, but you have to explain why ' \
'the Ubuntu changes can be dropped.'
raw_input_exit_on_ctrlc('Press [Enter] to retry or [Control-C] to abort. ')
else:
changes_required = False
report_file.seek(0)
report = report_file.read()

View File

@ -55,7 +55,7 @@ Your sync request shall require an approval by a member of the appropriate
sponsorship team, who shall be subscribed to this bug report.
This must be done before it can be processed by a member of the Ubuntu Archive
team.'''
raw_input_exit_on_ctrlc('If the above is correct please press [Enter]: ')
raw_input_exit_on_ctrlc('If the above is correct please press [Enter] ')
return need_sponsor
@ -73,10 +73,10 @@ def checkExistingReports(srcpkg):
# Search bug list for other sync requests.
for bug in pkgBugList:
# check for Sync or sync and the package name
if 'ync %s' % package in bug.title:
if not bug.is_complete and 'ync %s' % srcpkg in bug.title:
print 'The following bug could be a possible duplicate sync bug on Launchpad:'
print ' * Bug #%i: %s (%s)' % \
(bug.id, bug.title, translate_api_web(bug.self_link))
print ' * %s (%s)' % \
(bug.title, translate_api_web(bug.self_link))
print 'Please check the above URL to verify this before continuing.'
raw_input_exit_on_ctrlc('Press [Enter] to continue or [Ctrl-C] to abort. ')
@ -96,7 +96,7 @@ def postBug(srcpkg, subscribe, status, bugtitle, bugtext):
bug_target = Distribution('ubuntu')
# create bug
bug = Launchpad.bugs.createBug(title = bugtitle, description = bugtext, target = bug_target)
bug = Launchpad.bugs.createBug(title = bugtitle, description = bugtext, target = bug_target())
# newly created bugreports have only one task
task = bug.bug_tasks[0]
@ -106,7 +106,7 @@ def postBug(srcpkg, subscribe, status, bugtitle, bugtext):
task.status = status
task.lp_save()
bug.subscribe(person = PersonTeam(subscribe))
bug.subscribe(person = PersonTeam(subscribe)())
print 'Sync request filed as bug #%i: %s' % (bug.id,
translate_api_web(bug.self_link))

View File

@ -31,6 +31,8 @@ __all__ = [
'getDebianSrcPkg',
'getUbuntuSrcPkg',
'getEmailAddress',
'needSponsorship',
'checkExistingReports',
'mailBug',
]
@ -111,7 +113,7 @@ def needSponsorship(name, component):
while True:
print "Do you have upload permissions for the '%s' component " \
"or the package '%s'?" % (component, name)
val = raw_input_exit_on_ctrlc("If in doubt answer 'no'. [y/N]? ")
val = raw_input_exit_on_ctrlc("If in doubt answer 'n'. [y/N]? ")
if val.lower() in ('y', 'yes'):
return False
elif val.lower() in ('n', 'no', ''):
@ -123,7 +125,8 @@ def checkExistingReports(srcpkg):
'''
Point the user to the URL to manually check for duplicate bug reports.
'''
print 'Please check on https://bugs.launchpad.net/ubuntu/+source/%s/+bugs for duplicate sync requests before continuing.'
print 'Please check on https://bugs.launchpad.net/ubuntu/+source/%s/+bugs\n' \
'for duplicate sync requests before continuing.' % srcpkg
raw_input_exit_on_ctrlc('Press [Enter] to continue or [Ctrl-C] to abort. ')
def mailBug(srcpkg, subscribe, status, bugtitle, bugtext, keyid = None):