Skip to content
Snippets Groups Projects
Commit ca822b7f authored by Robert Goldman's avatar Robert Goldman
Browse files

Fixes to bump-version script.

Better handled arguments.
Added usage/help handling
Fixed bug with parens in regexp.
parent f66a8842
Branches
Tags
No related merge requests found
...@@ -2,8 +2,21 @@ ...@@ -2,8 +2,21 @@
use FindBin; use FindBin;
use File::Slurper qw(read_text write_text); use File::Slurper qw(read_text write_text);
use Getopt::Long;
our $old; our $old;
our $new; our $new;
our $usage = 0;
&GetOptions("help"=>\$usage,
"usage"=>\$usage);
if ($usage) {
print "$0 [old-version] [new-version]\n";
print "\tIf only one argument, treat it as the new version argument.\n";
print "\tIf two arguments treat the first as old version number and second as new.\n";
print "\n\tBumps the version numbers in all the relevant files.\n";
exit 0;
}
our $asdf_dir = $FindBin::RealBin . "/../"; our $asdf_dir = $FindBin::RealBin . "/../";
our $file = $asdf_dir . "version.lisp-expr"; our $file = $asdf_dir . "version.lisp-expr";
...@@ -14,14 +27,14 @@ our @transform_ref = ...@@ -14,14 +27,14 @@ our @transform_ref =
[ "uiop/version.lisp-expr", "\"", "\"" ], [ "uiop/version.lisp-expr", "\"", "\"" ],
[ "asdf.asd", " :version \"", "\" ;; to be automatically updated by make bump-version" ], [ "asdf.asd", " :version \"", "\" ;; to be automatically updated by make bump-version" ],
[ "header.lisp", "This is ASDF ", ": Another System Definition Facility." ], [ "header.lisp", "This is ASDF ", ": Another System Definition Facility." ],
[ "upgrade.lisp", " (asdf-version \"", "\")" ], [ "upgrade.lisp", "\\(asdf-version \"", "\"\\)" ],
[ "doc/asdf.texinfo", "Manual for Version ", "" ], ); [ "doc/asdf.texinfo", "Manual for Version ", "" ], );
if ($1 && $2) { if ($#ARGV == 1) {
$old = $1; $old = $ARGV[0];
$new = $2; $new = $ARGV[1];
} elsif ($1) { } elsif ($#ARGV == 0) {
$new = $1; $new = $ARGV[0];
$old = read_asdf_version(); $old = read_asdf_version();
} else { } else {
$old = read_asdf_version(); $old = read_asdf_version();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment