]> granicus.if.org Git - docbook-dsssl/commitdiff
Made some minor changes to get deal with a couple corner cases.
authorMichael Smith <xmldoc@users.sourceforge.net>
Tue, 20 Sep 2005 05:42:26 +0000 (05:42 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Tue, 20 Sep 2005 05:42:26 +0000 (05:42 +0000)
If somebody (say, Mike) checks in the VERSION file twice with the
same change description, it's possible for the merged changelog to
end with up something like:

  * VERSION, VERSION: Version 1.69.1 released.

The existing version of mergechangelogs got confused by that, so I
added a regex match to catch instances like that.

Also, in running the snapshot builds, with the way I have the
snapshot build currently set up, it's useful for the build to just
automatically assume we are at version X.XX.1 if the previous
version was X.XX.0.
----------------------------------------------------------------------

cvstools/mergechangelogs

index 52e455c516e9f0a68a2317526106e37918d48ffd..12f5d50486d389ab865e8c0eb138952210a97a36 100755 (executable)
@@ -42,6 +42,10 @@ while (<F>) {
     $date = $1 if /^(\d+-\d+-\d+)/;
     $found = 1 if /^\s+\* \S+: Version $version\s+/;
     $found = 1 if /^\s+\* \S+: Version $version\s*$/;
+    # following match needed because Changelog might have
+    # "* VERSION, VERSION: Version 1.69.1 released." (if same
+    # change description was entered twice). -Mike
+    $found = 1 if /^\s+\* [^:]+: Version $version\s+/;
     last if $found;
 }
 
@@ -150,7 +154,10 @@ sub last_version {
        my $minor = $3;
 
        if ($minor == 0) {
-           die "Can\'t calculate preceding from $version.\n";
+       # do the following in order to get useful merged changelog
+       # for snapshot builds --Mike
+           $middle--;
+           $minor++;
        } else {
            $minor--;
        }