sponsor-patch: Fix crash if uploading to ubuntu without building the package before.

This commit is contained in:
Benjamin Drung 2010-12-22 00:52:45 +01:00
parent d264ee7e97
commit 0a35d3d13d
2 changed files with 31 additions and 23 deletions

3
debian/changelog vendored
View File

@ -27,8 +27,9 @@ ubuntu-dev-tools (0.109) UNRELEASED; urgency=low
- Add new --lpinstance and --no-conf options. - Add new --lpinstance and --no-conf options.
- Support configuration files. - Support configuration files.
- Fix 'str' object has no attribute 'startwith' crash caused by a typo. - Fix 'str' object has no attribute 'startwith' crash caused by a typo.
- Fix crash if uploading to ubuntu without building the package before.
-- Benjamin Drung <bdrung@ubuntu.com> Tue, 21 Dec 2010 22:47:20 +0100 -- Benjamin Drung <bdrung@ubuntu.com> Wed, 22 Dec 2010 00:51:48 +0100
ubuntu-dev-tools (0.108) experimental; urgency=low ubuntu-dev-tools (0.108) experimental; urgency=low

View File

@ -394,9 +394,13 @@ def main(bug_number, build, builder, edit, keyid, lpinstance, update, upload,
ask_for_manual_fixing() ask_for_manual_fixing()
continue continue
build_log = None
if build: if build:
dist = re.sub("-.*$", "", changelog.distributions) dist = re.sub("-.*$", "", changelog.distributions)
buildresult = os.path.join(workdir, "buildresult") buildresult = os.path.join(workdir, "buildresult")
build_name = task.package + "_" + strip_epoch(new_version) + \
"_" + builder.get_architecture() + ".build"
build_log = os.path.join(buildresult, build_name)
successful_built = False successful_built = False
while not successful_built: while not successful_built:
@ -429,13 +433,18 @@ def main(bug_number, build, builder, edit, keyid, lpinstance, update, upload,
# We want to do a manual fix if the build failed. # We want to do a manual fix if the build failed.
continue continue
# Check lintian # Determine whether to use the source or binary build for lintian
changes_name = task.package + "_" + strip_epoch(new_version) + \ if build_log:
build_changes = task.package + "_" + strip_epoch(new_version) + \
"_" + builder.get_architecture() + ".changes" "_" + builder.get_architecture() + ".changes"
build_changes = os.path.join(buildresult, changes_name) changes_for_lintian = os.path.join(buildresult, build_changes)
assert os.path.isfile(build_changes), "%s does not exist." % \ else:
(build_changes) changes_for_lintian = changes_file
cmd = ["lintian", "-IE", "--pedantic", "-q", build_changes]
# Check lintian
assert os.path.isfile(changes_for_lintian), "%s does not exist." % \
(changes_for_lintian)
cmd = ["lintian", "-IE", "--pedantic", "-q", changes_for_lintian]
lintian_filename = os.path.join(workdir, lintian_filename = os.path.join(workdir,
task.package + "_" + strip_epoch(new_version) + ".lintian") task.package + "_" + strip_epoch(new_version) + ".lintian")
Logger.command(cmd + [">", lintian_filename]) Logger.command(cmd + [">", lintian_filename])
@ -450,13 +459,11 @@ def main(bug_number, build, builder, edit, keyid, lpinstance, update, upload,
# Upload package # Upload package
if upload: if upload:
if upload == "ubuntu": if upload == "ubuntu":
build_name = task.package + "_" + strip_epoch(new_version) + \ print "Please check %s %s carefully:\nfile://%s\nfile://%s" % \
"_" + builder.get_architecture() + ".build" (task.package, new_version, debdiff_filename,
build_log = os.path.join(buildresult, build_name) lintian_filename)
print "Please check %s %s carefully:\nfile://%s\nfile://%s\n" \ if build_log:
"file://%s" % (task.package, new_version, print "\nfile://%s" % build_log
debdiff_filename, lintian_filename,
build_log)
question = Question(["yes", "edit", "no"]) question = Question(["yes", "edit", "no"])
answer = question.ask("Do you want to upload the package to " \ answer = question.ask("Do you want to upload the package to " \
"the official Ubuntu archive", "yes") "the official Ubuntu archive", "yes")