Author: adsb
Date: 2009-02-11 20:42:13 +0000 (Wed, 11 Feb 2009)
New Revision: 1813

Modified:
   trunk/debian/changelog
   trunk/scripts/debchange.1
   trunk/scripts/debchange.pl
Log:
Modify --bpo to produce a changelog suitable for uploading to
lenny-backports rather than etch-backports by default.  If the latest
changelog entry is for an etch backport, a new etch-backports stanza
will be produced instead.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2009-02-11 19:35:49 UTC (rev 1812)
+++ trunk/debian/changelog      2009-02-11 20:42:13 UTC (rev 1813)
@@ -10,6 +10,10 @@
       distributions. (Closes: #514818)
     + Don't accept "sarge", "etch" or "lenny" as valid distributions. dak
       requires suite names (e.g. "stable") rather than codenames.
+    + Modify --bpo to produce a changelog suitable for uploading to
+      lenny-backports rather than etch-backports by default.  If the latest
+      changelog entry is for an etch backport, a new etch-backports stanza
+      will be produced instead.
   * licensecheck:
     + Remove C /* */ comments. Based on a patch by Jörg Sommer.
     + Identify another form of GPL wording.

Modified: trunk/scripts/debchange.1
===================================================================
--- trunk/scripts/debchange.1   2009-02-11 19:35:49 UTC (rev 1812)
+++ trunk/scripts/debchange.1   2009-02-11 20:42:13 UTC (rev 1813)
@@ -218,7 +218,7 @@
 upload, and add a Security Team upload changelog comment.
 .TP
 .B \-\-bpo
-Increment the Debian release number for a upload to etch-backports,
+Increment the Debian release number for an upload to lenny-backports,
 and add a backport upload changelog comment.
 .TP
 .B \-\-local ", " \-l \fIsuffix\fR

Modified: trunk/scripts/debchange.pl
===================================================================
--- trunk/scripts/debchange.pl  2009-02-11 19:35:49 UTC (rev 1812)
+++ trunk/scripts/debchange.pl  2009-02-11 20:42:13 UTC (rev 1813)
@@ -110,7 +110,7 @@
          Increment the Debian release number for a Debian Security Team upload
   --bpo
          Increment the Debian release number for a Backports.org upload
-        to "etch-backports"
+        to "lenny-backports"
   -l, --local <suffix>
          Add a suffix to the Debian version number for a local build
   -b, --force-bad-version
@@ -484,6 +484,8 @@
 my $EMAIL = 'EMAIL';
 my $DISTRIBUTION = 'UNRELEASED';
 my $bpo_dist = '';
+my %bpo_dists = ( '40', 'etch', '50', 'lenny' );
+my $latest_bpo_dist = '50';
 my $CHANGES = '';
 # Changelog urgency, possibly propogated to NEWS files
 my $CL_URGENCY = '';
@@ -1003,7 +1005,7 @@
            } 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
-               $end .= "~bpo40+1";
+               $end .= "~bpo$latest_bpo_dist+1";
            } elsif ($opt_l and not $start =~ /\Q$opt_l\E/) {
                # If it's not already a local package make it so
                # otherwise we can be safe if we behave like dch -i
@@ -1012,6 +1014,21 @@
                # Don't bump the version of a NEWS file in this case as we're
                # using the version from the changelog
                $end++;
+
+               # Attempt to set the distribution for a backport correctly
+               # based on the version of the previous backport
+               if ($opt_bpo) {
+                   my $previous_dist = $start;
+                   $previous_dist =~ s/^.*~bpo([0-9]+)\+$/$1/;
+                   if (defined $previous_dist and defined
+                       $bpo_dists{$previous_dist}) {
+                       $bpo_dist = $bpo_dists{$previous_dist} . '-backports';
+                   } else {
+                       # Fallback to using the previous distribution
+                       $bpo_dist = $changelog{'Distribution'};
+                   }
+               }
+
                if (! ($opt_qa or $opt_bpo or $opt_l)) {
                    $useextra = 1;
                }
@@ -1035,7 +1052,7 @@
     }
 
     if ($opt_bpo) {
-       $bpo_dist='etch-backports';
+       $bpo_dist ||= $bpo_dists{$latest_bpo_dist} . '-backports';
     }
     my $distribution = $opt_D || $bpo_dist || (($opt_release_heuristic eq 
'changelog') ? "UNRELEASED" : $DISTRIBUTION);
     
@@ -1067,7 +1084,7 @@
             print O "  * Non-maintainer upload by the Security Team.\n";
             $line = 1;
        } elsif ($opt_bpo && ! $opt_news) {
-            print O "  * Rebuild for etch-backports.\n";
+            print O "  * Rebuild for $bpo_dist.\n";
             $line = 1;
        }
        if (@closes_text or $TEXT) {



-- 
To unsubscribe, send mail to [email protected].

Reply via email to