From: Norman W. <nw...@us...> - 2002-05-12 11:50:19
|
Update of /cvsroot/docbook/cvstools In directory usw-pr-cvs1:/tmp/cvs-serv16900 Modified Files: mergechangelogs Log Message: Handle 3-part version numbers Index: mergechangelogs =================================================================== RCS file: /cvsroot/docbook/cvstools/mergechangelogs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** mergechangelogs 9 Jul 2001 11:12:07 -0000 1.3 --- mergechangelogs 12 May 2002 11:50:14 -0000 1.4 *************** *** 135,139 **** } ! if ($version =~ /(\d+)\.(\d+)/) { my $major = $1; my $minor = $2; --- 135,139 ---- } ! if ($version =~ /^(\d+)\.(\d+)$/) { my $major = $1; my $minor = $2; *************** *** 142,145 **** --- 142,157 ---- return "$major.$minor"; + } elsif ($version =~ /^(\d+)\.(\d+)\.(\d+)$/) { + my $major = $1; + my $middle = $2; + my $minor = $3; + + if ($minor == 0) { + die "Can\'t calculate preceding from $version.\n"; + } else { + $minor--; + } + + return "$major.$middle.$minor"; } else { return $version; |