Skip to content

Commit

Permalink
version script with selective setting
Browse files Browse the repository at this point in the history
git-svn-id: svn://scm.orgis.org/mpg123/trunk@5333 35dc7657-300d-0410-a2e5-dc2837fedb53
  • Loading branch information
thor committed Sep 19, 2023
1 parent f7e6b8c commit aff67e9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/version.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
{
die "$0: Give me a proper version to set!\n";
}
} elsif(@ARGV == 2)
{
$set = 1;
for($ARGV[0])
{
if(/-a/){ $v{MAJOR} = $ARGV[1]; }
if(/-i/){ $v{MINOR} = $ARGV[1]; }
if(/-p/){ $v{PATCH} = $ARGV[1]; }
if(/-s/){ $v{SUFFIX} = $ARGV[1]; }
}
}

chdir($Bin) or die "$0: cannot cd into $Bin: $!\n";
Expand All @@ -30,7 +40,7 @@
{
if(/^(#define\s+MPG123_)(MAJOR|MINOR|PATCH|SUFFIX)(\s+)(.+)$/)
{
if($set)
if($set and defined $v{$2})
{
my $val = $2 eq 'SUFFIX' ? '"'.$v{$2}.'"' : $v{$2};
$_ = $1.$2.$3.$val."\n";
Expand Down

0 comments on commit aff67e9

Please sign in to comment.