Patchwork [Saucy,1/1] UBUNTU: Require a tracking bug for every upload

login
register
mail settings
Submitter Leann Ogasawara
Date Aug. 2, 2013, 4:04 p.m.
Message ID <1375459442-16452-1-git-send-email-leann.ogasawara@canonical.com>
Download mbox | patch
Permalink /patch/264309/
State New
Headers show

Comments

Leann Ogasawara - Aug. 2, 2013, 4:04 p.m.
From: Leann Ogasawara <leann.ogasawara@canonical.com>

During the `fdr insertchanges` step of closing a release, parse the
changelog for the existence of a tracking bug.  If a tracking bug
doesn't exist, prevent insertion of changes.

Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
---
 debian/scripts/misc/insert-changes.pl |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
Tim Gardner - Aug. 3, 2013, 8:59 a.m.

Patch

diff --git a/debian/scripts/misc/insert-changes.pl b/debian/scripts/misc/insert-changes.pl
index c820597..90cacbc 100755
--- a/debian/scripts/misc/insert-changes.pl
+++ b/debian/scripts/misc/insert-changes.pl
@@ -13,6 +13,8 @@  open(CHANGES, "< $debian/changes") or die "Cannot open new changes";
 open(NEW, "> $debian/changelog.new") or die "Cannot open new changelog";
 
 $printed = 0;
+$tracking_bug = 0;
+$first_stanza = 1;
 
 while (<CHANGELOG>) {
 	if (/^  CHANGELOG: /) {
@@ -23,6 +25,12 @@  while (<CHANGELOG>) {
 		}
 
 		$printed = 1;
+	} elsif ($first_stanza && /^  \* Release Tracking Bug/) {
+		print NEW;
+		$tracking_bug = 1;
+	} elsif (/^ -- /) {
+		print NEW; 
+		$first_stanza = 0;
 	} else {
 		print NEW;
 	}
@@ -32,5 +40,11 @@  close(NEW);
 close(CHANGES);
 close(CHANGELOG);
 
-rename("$debian/changelog.new", "$debian/changelog");
+if (!$tracking_bug) {
+	print "ERROR: Tracking Bug Missing! (run create-release-tracker)\n";
+	unlink("$debian/changelog.new");
+} else {
+	rename("$debian/changelog.new", "$debian/changelog");
+}
+
 unlink("$debian/changes");