sponsor-patch: Fix bug introduces in revision 728.

This commit is contained in:
Benjamin Drung 2010-09-19 21:19:02 +02:00
parent 01265da7eb
commit 015d317cdf

View File

@ -338,9 +338,9 @@ def get_patch_or_branch(bug):
Print.error("No attachment and no linked branch found on bug #%i." \ Print.error("No attachment and no linked branch found on bug #%i." \
% (bug.id)) % (bug.id))
else: else:
Print.error(("No attached patch and no linked branch found. Go to " Print.error(("No attached patch and no linked branch found. Go " \
"https://launchpad.net/bugs/%i and mark an attachment " "to https://launchpad.net/bugs/%i and mark an " \
"as patch.") % (bug.id)) "attachment as patch.") % (bug.id))
sys.exit(1) sys.exit(1)
elif len(attached_patches) == 1 and len(linked_branches) == 0: elif len(attached_patches) == 1 and len(linked_branches) == 0:
patch = attached_patches[0] patch = attached_patches[0]
@ -348,13 +348,13 @@ def get_patch_or_branch(bug):
branch = linked_branches[0].bzr_identity branch = linked_branches[0].bzr_identity
else: else:
if len(attached_patches) == 0: if len(attached_patches) == 0:
Print.normal("https://launchpad.net/bugs/%i has %i branches " Print.normal("https://launchpad.net/bugs/%i has %i branches " \
"linked:" % (bug.id, len(linked_branches))) "linked:" % (bug.id, len(linked_branches)))
elif len(linked_branches) == 0: elif len(linked_branches) == 0:
Print.normal("https://launchpad.net/bugs/%i has %i patches" Print.normal("https://launchpad.net/bugs/%i has %i patches" \
" attached:" % (bug.id, len(attached_patches))) " attached:" % (bug.id, len(attached_patches)))
else: else:
Print.normal("https://launchpad.net/bugs/%i has %i branch(es)" Print.normal("https://launchpad.net/bugs/%i has %i branch(es)" \
" linked and %i patch(es) attached:" % \ " linked and %i patch(es) attached:" % \
(bug.id, len(linked_branches), len(attached_patches))) (bug.id, len(linked_branches), len(attached_patches)))
i = 0 i = 0
@ -531,7 +531,7 @@ def main(script_name, bug_number, build, edit, keyid, upload, verbose=False):
try: try:
new_version = changelog.get_version() new_version = changelog.get_version()
except IndexError: except IndexError:
Print.error("Debian package version could not be determined. " Print.error("Debian package version could not be determined. " \
"debian/changelog is probably malformed.") "debian/changelog is probably malformed.")
ask_for_manual_fixing() ask_for_manual_fixing()
continue continue
@ -539,7 +539,7 @@ def main(script_name, bug_number, build, edit, keyid, upload, verbose=False):
# Check if version of the new package is greater than the version in # Check if version of the new package is greater than the version in
# the archive. # the archive.
if new_version <= task.get_version(): if new_version <= task.get_version():
Print.error("The version %s is not greater than the already " Print.error("The version %s is not greater than the already " \
"available %s." % (new_version, task.get_version())) "available %s." % (new_version, task.get_version()))
ask_for_manual_fixing() ask_for_manual_fixing()
continue continue
@ -579,8 +579,8 @@ def main(script_name, bug_number, build, edit, keyid, upload, verbose=False):
new_dsc_file = os.path.join(workdir, new_dsc_file = os.path.join(workdir,
task.package + "_" + strip_epoch(new_version) + ".dsc") task.package + "_" + strip_epoch(new_version) + ".dsc")
assert os.path.isfile(dsc_file), "%s does not exist." % (dsc_file) assert os.path.isfile(dsc_file), "%s does not exist." % (dsc_file)
assert os.path.isfile(new_dsc_file), assert os.path.isfile(new_dsc_file), "%s does not exist." % \
"%s does not exist." % (new_dsc_file) (new_dsc_file)
cmd = ["debdiff", dsc_file, new_dsc_file] cmd = ["debdiff", dsc_file, new_dsc_file]
debdiff_name = task.package + "_" + strip_epoch(new_version) + \ debdiff_name = task.package + "_" + strip_epoch(new_version) + \
".debdiff" ".debdiff"
@ -613,7 +613,7 @@ def main(script_name, bug_number, build, edit, keyid, upload, verbose=False):
allowed = map(lambda s: s + "-proposed", supported_series) + \ allowed = map(lambda s: s + "-proposed", supported_series) + \
[devel_series] [devel_series]
if changelog.distributions not in allowed: if changelog.distributions not in allowed:
Print.error("%s is not an allowed series. It needs to be one " Print.error("%s is not an allowed series. It needs to be one " \
"of %s." % (changelog.distributions, "of %s." % (changelog.distributions,
", ".join(allowed))) ", ".join(allowed)))
ask_for_manual_fixing() ask_for_manual_fixing()
@ -621,7 +621,7 @@ def main(script_name, bug_number, build, edit, keyid, upload, verbose=False):
elif upload and upload.startwith("ppa/"): elif upload and upload.startwith("ppa/"):
allowed = supported_series + [devel_series] allowed = supported_series + [devel_series]
if changelog.distributions not in allowed: if changelog.distributions not in allowed:
Print.error("%s is not an allowed series. It needs to be one " Print.error("%s is not an allowed series. It needs to be one " \
"of %s." % (changelog.distributions, "of %s." % (changelog.distributions,
", ".join(allowed))) ", ".join(allowed)))
ask_for_manual_fixing() ask_for_manual_fixing()
@ -673,12 +673,12 @@ def main(script_name, bug_number, build, edit, keyid, upload, verbose=False):
build_name = task.package + "_" + strip_epoch(new_version) + \ build_name = task.package + "_" + strip_epoch(new_version) + \
"_" + architecture + ".build" "_" + architecture + ".build"
build_log = os.path.join(buildresult, build_name) build_log = os.path.join(buildresult, build_name)
print "Please check %s %s carefully:\nfile://%s\nfile://%s\n" print "Please check %s %s carefully:\nfile://%s\nfile://%s\n" \
"file://%s" % (task.package, new_version, debdiff_file, "file://%s" % (task.package, new_version, debdiff_file,
lintian_file, build_log) lintian_file, build_log)
answer = yes_edit_no_question("Do you want to upload the " answer = yes_edit_no_question("Do you want to upload the " \
"package to the official Ubuntu " "package to the official " \
"archive", "yes") "Ubuntu archive", "yes")
if answer == "edit": if answer == "edit":
continue continue
elif answer == "no": elif answer == "no":