[SCM] Git repository for devscripts branch, master, updated. v2.11.7-27-g1676d65

Benjamin Drung bdrung at debian.org
Mon May 28 21:36:43 UTC 2012


The following commit has been merged in the master branch:
commit 1676d658ef78d79c54172d9d1c0a28bce39b3601
Author: Benjamin Drung <bdrung at debian.org>
Date:   Mon May 28 23:36:37 2012 +0200

    debchange: Add -R/--rebuild flag for Ubuntu's no-change rebuilds.

diff --git a/debian/changelog b/debian/changelog
index 9bac70f..10a1f64 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -29,6 +29,7 @@ devscripts (2.11.8) UNRELEASED; urgency=low
     + Fall back to Debian vendor when a Debian-specific command-line option
       has been supplied (--nmu, --qa, --bin-nmu, --bpo).
     + Adjust --security template for Ubuntu.
+    + Add -R/--rebuild flag for Ubuntu's no-change rebuilds.
 
   [ Stefano Rivera ]
   * devscripts.Logger Don't substitute arguments into logged strings unless
diff --git a/scripts/debchange.1 b/scripts/debchange.1
index 361fb80..aae6189 100644
--- a/scripts/debchange.1
+++ b/scripts/debchange.1
@@ -224,6 +224,10 @@ incrementing a binNMU version number, and add a binNMU changelog comment.
 Increment the Debian release number for a Debian QA Team upload, and
 add a \fBQA upload\fR changelog comment.
 .TP
+.BR \-\-rebuild ", " \-R
+Increment the Debian release number for an Ubuntu no-change rebuild by
+appending a "build1" or by incrementing a rebuild version number.
+.TP
 .BR \-\-security ", " \-s
 Increment the Debian release number for a Debian Security Team non-maintainer
 upload, and add a \fBSecurity Team upload\fR changelog comment.
diff --git a/scripts/debchange.pl b/scripts/debchange.pl
index 30e1df9..d5aea3b 100755
--- a/scripts/debchange.pl
+++ b/scripts/debchange.pl
@@ -118,6 +118,8 @@ Options:
          Increment the Debian release number for a binary non-maintainer upload
   -q, --qa
          Increment the Debian release number for a Debian QA Team upload
+  -R, --rebuild
+         Increment the Debian release number for an Ubuntu no-change rebuild
   -s, --security
          Increment the Debian release number for a Debian Security Team upload
   --team
@@ -191,8 +193,8 @@ Options:
          Display this help message and exit
   --version
          Display version information
-  At most one of -a, -i, -e, -r, -v, -d, -n, --bin-nmu, -q, --qa, -s, --team, --bpo, -l
-  (or their long equivalents) may be used.
+  At most one of -a, -i, -e, -r, -v, -d, -n, --bin-nmu, -q, --qa, -R, -s,
+  --team, --bpo, -l (or their long equivalents) may be used.
   With no options, one of -i or -a is chosen by looking for a .upload
   file in the parent directory and checking its contents.
 
@@ -312,7 +314,7 @@ if (@ARGV and $ARGV[0] =~ /^--no-?conf$/) {
 # with older debchange versions.
 my ($opt_help, $opt_version);
 my ($opt_i, $opt_a, $opt_e, $opt_r, $opt_v, $opt_b, $opt_d, $opt_D, $opt_u, $opt_force_dist);
-my ($opt_n, $opt_bn, $opt_qa, $opt_s, $opt_team, $opt_bpo, $opt_l, $opt_c, $opt_m, $opt_M, $opt_create, $opt_package, @closes);
+my ($opt_n, $opt_bn, $opt_qa, $opt_R, $opt_s, $opt_team, $opt_bpo, $opt_l, $opt_c, $opt_m, $opt_M, $opt_create, $opt_package, @closes);
 my ($opt_news);
 my ($opt_level, $opt_regex, $opt_noconf, $opt_empty);
 
@@ -337,6 +339,7 @@ GetOptions("help|h" => \$opt_help,
 	   "n|nmu" => \$opt_n,
 	   "bin-nmu" => \$opt_bn,
 	   "q|qa" => \$opt_qa,
+	   "R|rebuild" => \$opt_R,
 	   "s|security" => \$opt_s,
 	   "team" => \$opt_team,
 	   "bpo" => \$opt_bpo,
@@ -391,8 +394,8 @@ if (defined $opt_level) {
 if (defined $opt_regex) { $check_dirname_regex = $opt_regex; }
 
 # Only allow at most one non-help option
-fatal "Only one of -a, -i, -e, -r, -v, -d, -n/--nmu, --bin-nmu, -q/--qa, -s/--security, --team, --bpo, -l/--local is allowed;\ntry $progname --help for more help"
-    if ($opt_i?1:0) + ($opt_a?1:0) + ($opt_e?1:0) + ($opt_r?1:0) + ($opt_v?1:0) + ($opt_d?1:0) + ($opt_n?1:0) + ($opt_bn?1:0) + ($opt_qa?1:0) + ($opt_s?1:0) + ($opt_team?1:0) + ($opt_bpo?1:0) + ($opt_l?1:0) > 1;
+fatal "Only one of -a, -i, -e, -r, -v, -d, -n/--nmu, --bin-nmu, -q/--qa, -R/--rebuild, -s/--security, --team, --bpo, -l/--local is allowed;\ntry $progname --help for more help"
+    if ($opt_i?1:0) + ($opt_a?1:0) + ($opt_e?1:0) + ($opt_r?1:0) + ($opt_v?1:0) + ($opt_d?1:0) + ($opt_n?1:0) + ($opt_bn?1:0) + ($opt_qa?1:0) + ($opt_R?1:0) + ($opt_s?1:0) + ($opt_team?1:0) + ($opt_bpo?1:0) + ($opt_l?1:0) > 1;
 
 if ($opt_s) {
     $opt_u = "high";
@@ -453,8 +456,9 @@ fatal "--package cannot be used when creating a NEWS file"
 
 if ($opt_create) {
     if ($opt_a || $opt_i || $opt_e || $opt_r || $opt_b || $opt_n || $opt_bn ||
-	    $opt_qa || $opt_s || $opt_team || $opt_bpo || $opt_l || $opt_allow_lower) {
-	warn "$progname warning: ignoring -a/-i/-e/-r/-b/--allow-lower-version/-n/--bin-nmu/-q/--qa/-s/--team/--bpo/-l options with --create\n";
+	    $opt_qa || $opt_R || $opt_s || $opt_team || $opt_bpo || $opt_l ||
+	    $opt_allow_lower) {
+	warn "$progname warning: ignoring -a/-i/-e/-r/-b/--allow-lower-version/-n/--bin-nmu/-q/--qa/-R/-s/--team/--bpo/-l options with --create\n";
 	$warnings++;
     }
     if ($opt_package && $opt_d) {
@@ -756,11 +760,13 @@ if ($opt_M) {
 #####
 
 if ($opt_auto_nmu eq 'yes' and ! $opt_v and ! $opt_l and ! $opt_s and
-    ! $opt_team and ! $opt_qa and ! $opt_bpo and ! $opt_bn and ! $opt_n and ! $opt_c and
+    ! $opt_team and ! $opt_qa and ! $opt_R and ! $opt_bpo and ! $opt_bn and
+    ! $opt_n and ! $opt_c and
     ! (exists $ENV{'CHANGELOG'} and length $ENV{'CHANGELOG'}) and ! $opt_M and
     ! $opt_create and ! $opt_a_passed and ! $opt_r and ! $opt_e and
+    $vendor ne 'Ubuntu' and
     ! ($opt_release_heuristic eq 'changelog' and
-	$changelog{'Distribution'} eq 'UNRELEASED' and ! $opt_i_passed)) {
+       $changelog{'Distribution'} eq 'UNRELEASED' and ! $opt_i_passed)) {
 
     if (-f 'debian/control') {
 	if (have_lpdc()) {
@@ -890,8 +896,8 @@ if ($opt_news && !$opt_i && !$opt_a) {
 
 # Are we going to have to figure things out for ourselves?
 if (! $opt_i && ! $opt_v && ! $opt_d && ! $opt_a && ! $opt_e && ! $opt_r &&
-    ! $opt_n && ! $opt_bn && ! $opt_qa && ! $opt_s && ! $opt_team && ! $opt_bpo &&
-    ! $opt_l && ! $opt_create) {
+    ! $opt_n && ! $opt_bn && ! $opt_qa && ! $opt_R && ! $opt_s && ! $opt_team &&
+    ! $opt_bpo && ! $opt_l && ! $opt_create) {
     # Yes, we are
     if ($opt_release_heuristic eq 'log') {
 	my @UPFILES = glob("../$PACKAGE\_$SVERSION\_*.upload");
@@ -967,7 +973,8 @@ my $line;
 my $optionsok=0;
 my $merge=0;
 
-if (($opt_i || $opt_n || $opt_bn || $opt_qa || $opt_s || $opt_team || $opt_bpo || $opt_l || $opt_v || $opt_d ||
+if (($opt_i || $opt_n || $opt_bn || $opt_qa || $opt_R || $opt_s || $opt_team ||
+     $opt_bpo || $opt_l || $opt_v || $opt_d ||
     ($opt_news && $VERSION ne $changelog{'Version'})) && ! $opt_create) {
 
     $optionsok=1;
@@ -1060,6 +1067,9 @@ if (($opt_i || $opt_n || $opt_bn || $opt_qa || $opt_s || $opt_team || $opt_bpo |
 		$debian_revision++;
 		$start = "$upstream_version-$debian_revision";
 		$end = "";
+	    } elsif ($opt_R and $vendor eq 'Ubuntu' and
+	             not $start =~ /build/ and not $start =~ /ubuntu/) {
+		$end .= "build1";
 	    } elsif ($opt_bpo and not $start =~ /~bpo[0-9]+\+$/) {
 		# If it's not already a backport make it so
 		# otherwise we can be safe if we behave like dch -i
diff --git a/test/test_debchange b/test/test_debchange
index 239ca7e..e4fb90a 100755
--- a/test/test_debchange
+++ b/test/test_debchange
@@ -19,7 +19,7 @@ COMMAND="perl -I ${0%/*}/.. ${0%/*}/../scripts/debchange.pl"
 . "${0%/*}/shunit2-helper-functions.sh"
 
 success() {
-    runCommand "-c ${SHUNIT_TMPDIR}/changelog --package devscripts-test-package $1" "" "" 0
+    runCommand "-c ${SHUNIT_TMPDIR}/changelog $1" "" "" 0
 }
 
 checkVersion() {
@@ -28,7 +28,7 @@ checkVersion() {
     local start_version="$3"
     local expected_version="$4"
     rm -f ${SHUNIT_TMPDIR}/changelog
-    success "--create $start_param -v $start_version \"Devscripts Test Suite.\""
+    success "--create $start_param --package test-package -v $start_version \"Devscripts Test Suite.\""
     success "$param \"Version test.\""
     local version=$(dpkg-parsechangelog -l${SHUNIT_TMPDIR}/changelog | sed -n 's/^Version: //p')
     assertEquals "\"dch $param\" from version $start_version" "$expected_version" "$version"
@@ -38,9 +38,20 @@ checkDebianVersion() {
     checkVersion "--vendor Debian -D unstable" "--vendor Debian $1" "$2" "$3"
 }
 
+checkUbuntuVersion() {
+    checkVersion "--vendor Debian -D unstable" "--vendor Ubuntu $1" "$2" "$3"
+}
+
 testDebianIncrement() {
     checkDebianVersion "-i" "1.0-1" "1.0-2"
     checkDebianVersion "-i" "12" "13"
 }
 
+testUbuntuRebuild() {
+    checkUbuntuVersion "-R" "3.4" "3.4build1"
+    checkUbuntuVersion "-R" "2.0-4" "2.0-4build1"
+    checkUbuntuVersion "-R" "1.42-4ubuntu5" "1.42-4ubuntu6"
+    checkUbuntuVersion "-R" "0.1-2build3" "0.1-2build4"
+}
+
 . shunit2

-- 
Git repository for devscripts



More information about the devscripts-devel mailing list