From 1fc55fe66de2596ef0d918a19d30610118bac2d5 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Fri, 9 Sep 2011 23:54:36 +0200 Subject: [PATCH] * submittodebian: - Don't parse the entire changelog, to avoid bumping into past illegal version numbers (LP: #727314) - Iterate over changelog blocks rather than using Chancgelog's private _blocks list. [ Stefano Rivera ] * --- debian/changelog | 10 ++++++++-- submittodebian | 10 ++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 89fcd01..1cd28c6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,11 @@ ubuntu-dev-tools (0.131) UNRELEASED; urgency=low (LP: #845487) * requestsync: Add nice error messages to gpg-signing code, rather than simple assertions (LP: #537288) - * submittodebian: Don't parse the entire changelog, to avoid bumping into - past illegal version numbers (LP: #727314) + * submittodebian: + - Don't parse the entire changelog, to avoid bumping into past illegal + version numbers (LP: #727314) + - Iterate over changelog blocks rather than using Chancgelog's private + _blocks list. * ubuntutools.update_maintainer: Don't use strict changelog parsing (LP: #806633) * setup-packaging-environment: Software Sources isn't on the Administration @@ -19,6 +22,9 @@ ubuntu-dev-tools (0.131) UNRELEASED; urgency=low [ Colin Watson ] * syncpackage: Fix typo. + [ Stefano Rivera ] + * + -- Stefano Rivera Thu, 08 Sep 2011 23:13:05 +0200 ubuntu-dev-tools (0.130) unstable; urgency=low diff --git a/submittodebian b/submittodebian index f19a267..f697543 100755 --- a/submittodebian +++ b/submittodebian @@ -45,12 +45,13 @@ if not os.path.exists('/usr/bin/reportbug'): sys.exit(1) def get_most_recent_debian_version(changelog): - for block in changelog._blocks: + for block in changelog: version = block.version.full_version if not re.search('(ubuntu|build)', version): return version def get_bug_body(changelog): + entry = next(iter(changelog)) msg = """In Ubuntu, the attached patch was applied to achieve the following: ## ---------------- REPLACE THIS WITH ACTUAL INFORMATION --------------------- @@ -63,14 +64,15 @@ def get_bug_body(changelog): %s Thanks for considering the patch. -""" % ("\n".join([a for a in changelog._blocks[0].changes()])) +""" % ("\n".join([a for a in entry.changes()])) return msg def gen_debdiff(changelog): pkg = changelog.package - oldver = changelog._blocks[1].version - newver = changelog._blocks[0].version + changelog_it = iter(changelog) + newver = next(changelog_it).version + oldver = next(changelog_it).version (fd, debdiff) = mkstemp() os.close(fd)