Author: adsb
Date: 2009-01-02 18:18:58 +0000 (Fri, 02 Jan 2009)
New Revision: 1772

Modified:
   trunk/debian/changelog
   trunk/scripts/debchange.pl
Log:
Attempt to do the right thing (or at least something sensible) if the
package version ends in a tilde. (Closes: #510313)

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2009-01-02 18:12:10 UTC (rev 1771)
+++ trunk/debian/changelog      2009-01-02 18:18:58 UTC (rev 1772)
@@ -13,6 +13,8 @@
     rather than hard-coding bugs.debian.org.
   * debchange:
     + Correctly increment bpo version numbers.
+    + Attempt to do the right thing (or at least something sensible) if the
+      package version ends in a tilde. (Closes: #510313)
   * debdiff:
     + Fix a couple of formatting issues in the manpage.
     + Mention --{no-,}diffstat in the help message.

Modified: trunk/scripts/debchange.pl
===================================================================
--- trunk/scripts/debchange.pl  2009-01-02 18:12:10 UTC (rev 1771)
+++ trunk/scripts/debchange.pl  2009-01-02 18:18:58 UTC (rev 1772)
@@ -538,6 +538,7 @@
            chomp;
            if (m%^Version:\s+(\S+)$%) {
                $VERSION = $1;
+               $VERSION =~ s/~$//;
                last;
            }
        }
@@ -961,7 +962,9 @@
     # including epochs.
 
     if (! $NEW_VERSION) {
-       if ($VERSION =~ /(.*?)([a-yA-Y][a-zA-Z]*|\d+)$/i) {
+       if ($VERSION =~ /(.*?)([a-yA-Y][a-zA-Z]*|\d+)(~)?$/i) {
+           my $extra=$3 || '';
+           my $useextra = 0;
            my $end=$2;
            my $start=$1;
            # If it's not already an NMU make it so
@@ -998,8 +1001,14 @@
                # Don't bump the version of a NEWS file in this case as we're
                # using the version from the changelog
                $end++;
+               if (! ($opt_qa or $opt_bpo or $opt_l)) {
+                   $useextra = 1;
+               }
            }
            $NEW_VERSION = "$start$end";
+           if ($useextra) {
+               $NEW_VERSION .= $extra;
+           }
            ($NEW_SVERSION=$NEW_VERSION) =~ s/^\d+://;
            ($NEW_UVERSION=$NEW_SVERSION) =~ s/-[^-]*$//;
        } else {



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

Reply via email to