diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-09-22 16:19:19 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-09-22 16:19:19 -0700 |
commit | b10f3e2dca1df539350ca3a77092d64fe44ceb25 (patch) | |
tree | e26bda26a090e9d5ccaf83425d463e94fb51a41c /version.pl | |
parent | af31d433683fc190ccda6593284c9d8160ca1adb (diff) | |
download | nasm-b10f3e2dca1df539350ca3a77092d64fe44ceb25.tar.gz nasm-b10f3e2dca1df539350ca3a77092d64fe44ceb25.tar.bz2 nasm-b10f3e2dca1df539350ca3a77092d64fe44ceb25.zip |
version.pl: support version numbers of the form X.Y[.Z]rcW
Support version numbers of the form X.Y[.Z]rcW where X, Y, Z and W are
numbers. For the numeric macros, drop them down to a lower level, so
2.0rc1 is treated as version 1.99.99.91.
Diffstat (limited to 'version.pl')
-rwxr-xr-x | version.pl | 32 |
1 files changed, 26 insertions, 6 deletions
@@ -35,18 +35,23 @@ $line = <STDIN>; chomp $line; undef $man, $min, $smin, $plvl, $tail; +$is_rc = 0; -if ( $line =~ /^([0-9]+)\.([0-9]+)/ ) { +if ( $line =~ /^([0-9]+)\.([0-9]+)(.*)$/ ) { $maj = $1; $min = $2; - $tail = $'; - if ( $tail =~ /^\.([0-9]+)/ ) { + $tail = $3; + if ( $tail =~ /^\.([0-9]+)(.*)$/ ) { $smin = $1; - $tail = $'; + $tail = $2; } - if ( $tail =~ /^(pl|\.)([0-9]+)/ ) { + if ( $tail =~ /^(pl|\.)([0-9]+)(.*)$/ ) { $plvl = $2; - $tail = $'; + $tail = $3; + } elsif ( $tail =~ /^rc([0-9]+)(.*)$/ ) { + $is_rc = 1; + $plvl = $1; + $tail = $2; } } else { die "$0: Invalid input format\n"; @@ -55,6 +60,21 @@ if ( $line =~ /^([0-9]+)\.([0-9]+)/ ) { $nmaj = $maj+0; $nmin = $min+0; $nsmin = $smin+0; $nplvl = $plvl+0; +if ($is_rc) { + $nplvl += 90; + if ($nsmin > 0) { + $nsmin--; + } else { + $nsmin = 99; + if ($nmin > 0) { + $nmin--; + } else { + $nmin = 99; + $nmaj--; + } + } +} + $nasm_id = ($nmaj << 24)+($nmin << 16)+($nsmin << 8)+$nplvl; if ( $what eq 'h' ) { |