sponsor-patch: Check if the sponsored bug is marked as duplicate (LP: #896733).

This commit is contained in:
Benjamin Drung 2011-12-21 21:44:22 +01:00
parent fb44f55379
commit 3f6eb545e2
3 changed files with 15 additions and 8 deletions

8
debian/changelog vendored
View File

@ -1,14 +1,16 @@
ubuntu-dev-tools (0.138) UNRELEASED; urgency=low ubuntu-dev-tools (0.138) UNRELEASED; urgency=low
[ Benjamin Drung ] [ Benjamin Drung ]
* sponsor-patch: Use syncpackage instead of subscribing ubuntu-archive for * sponsor-patch:
sync requests, because syncpackage supports sponsorship now. - Use syncpackage instead of subscribing ubuntu-archive for sync requests,
because syncpackage supports sponsorship now.
- Check if the sponsored bug is marked as duplicate (LP: #896733).
[ Stefano Rivera ] [ Stefano Rivera ]
* Correct reference to qemu-user-static in pbuilder-dist.1 (Closes: #651999) * Correct reference to qemu-user-static in pbuilder-dist.1 (Closes: #651999)
* mk-sbuild: Don't install devscripts by default (LP: #904502) * mk-sbuild: Don't install devscripts by default (LP: #904502)
-- Benjamin Drung <bdrung@debian.org> Sat, 10 Dec 2011 12:46:33 +0100 -- Benjamin Drung <bdrung@debian.org> Wed, 21 Dec 2011 21:42:27 +0100
ubuntu-dev-tools (0.137) unstable; urgency=low ubuntu-dev-tools (0.137) unstable; urgency=low

View File

@ -340,8 +340,8 @@ class SourcePackage(object):
debdiff_file.writelines(debdiff) debdiff_file.writelines(debdiff)
debdiff_file.close() debdiff_file.close()
def is_fixed(self, bug_number): def is_fixed(self, lp_bug):
"""Make sure that the given bug number is closed. """Make sure that the given Launchpad bug is closed.
Returns true if the bug is closed. Returns false if the user wants to Returns true if the bug is closed. Returns false if the user wants to
change something. change something.
@ -355,9 +355,14 @@ class SourcePackage(object):
fixed_bugs = changes["Launchpad-Bugs-Fixed"].split(" ") fixed_bugs = changes["Launchpad-Bugs-Fixed"].split(" ")
fixed_bugs = [int(bug) for bug in fixed_bugs] fixed_bugs = [int(bug) for bug in fixed_bugs]
if bug_number not in fixed_bugs: # Check if the given bug is marked as duplicate. In this case get the
# master bug.
while lp_bug.duplicate_of:
lp_bug = lp_bug.duplicate_of
if lp_bug.id not in fixed_bugs:
Logger.error("Launchpad bug #%i is not closed by new version." % \ Logger.error("Launchpad bug #%i is not closed by new version." % \
(bug_number)) (lp_bug.id))
ask_for_manual_fixing() ask_for_manual_fixing()
return False return False
return True return True

View File

@ -311,7 +311,7 @@ def sponsor_patch(bug_number, build, builder, edit, keyid, lpinstance, update,
source_package.generate_debdiff(dsc_file) source_package.generate_debdiff(dsc_file)
# Make sure that the Launchpad bug will be closed # Make sure that the Launchpad bug will be closed
if not source_package.is_fixed(bug_number): if not source_package.is_fixed(bug):
continue continue
if not source_package.check_target(upload, launchpad): if not source_package.check_target(upload, launchpad):