diff options
author | Abir Viqar <abiviq@hushmail.com> | 2013-12-14 14:03:59 -0500 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2013-12-19 17:26:25 +0000 |
commit | 5e1cf63ba35995df5a77e4c4eb5eb266ab2fc9b5 (patch) | |
tree | 0fae538dd8306c4407feeebe42ba36ef55214da9 | |
parent | 3bb80250e94a706e7c07159410002bd1a5299d4f (diff) | |
download | perl-5e1cf63ba35995df5a77e4c4eb5eb266ab2fc9b5.tar.gz |
Porting/corelist-perldelta.pl - Default to comparing last two versions
do_update_existing() previously required versions to be specified
-rwxr-xr-x | Porting/corelist-perldelta.pl | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Porting/corelist-perldelta.pl b/Porting/corelist-perldelta.pl index a91d27e9ef..0a9695e5df 100755 --- a/Porting/corelist-perldelta.pl +++ b/Porting/corelist-perldelta.pl @@ -57,9 +57,18 @@ sub run { # by default, compare latest two version in CoreList; my @versions = sort keys %Module::CoreList::version; - my ($old, $new) = (shift @ARGV, shift @ARGV); - $old ||= $versions[-2]; - $new ||= $versions[-1]; + my $old = $versions[-2]; + my $new = $versions[-1]; + + # use the provided versions if present + # @ARGV >=2 means [old_version] [new_version] [path/to/file] + if ( @ARGV >= 2) { + ($old, $new) = (shift @ARGV, shift @ARGV); + die "$old is an invalid version\n" if not exists + $Module::CoreList::version{$old}; + die "$new is an invalid verison\n" if not exists + $Module::CoreList::version{$new}; + } if ( $opt{mode} eq 'generate' ) { do_generate($old => $new); |