Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: file:///home/mbr/svn/gpgdir_repos/gpgdir/trunk@291 958e171a-1414-0410-8e2f-9d295d3c0db0
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/perl -w | ||
# | ||
############################################################################# | ||
# | ||
# File: bump_version.pl | ||
# | ||
# Purpose: Minor script to enforce consistency in gpgdir version tags. | ||
# | ||
############################################################################# | ||
# | ||
# $Id: bump_version.pl 1055 2008-05-21 02:57:17Z mbr $ | ||
# | ||
|
||
use strict; | ||
|
||
my @files = qw( | ||
gpgdir | ||
test/gpgdir_test.pl | ||
); | ||
|
||
my $new_version = $ARGV[0] or die "[*] $0 <new version>"; | ||
|
||
open F, '< VERSION' or die "[*] Could not open VERSION file: $!"; | ||
my $old_version = <F>; | ||
close F; | ||
chomp $old_version; | ||
|
||
print "[+] Updating software versions...\n"; | ||
for my $file (@files) { | ||
if ($file =~ /\.c/) { | ||
###* Version: 1.8.4-pre2 | ||
my $search_re = qr/^\*\s+Version:\s+$old_version/; | ||
my $replace_str = '* Version: ' . $new_version; | ||
system qq{perl -p -i -e 's|$search_re|} . | ||
qq{$replace_str|' $file}; | ||
} else { | ||
### Version: 1.8.4 | ||
my $search_re = qr/#\s+Version:\s+$old_version/; | ||
my $replace_str = '# Version: ' . $new_version; | ||
system qq{perl -p -i -e 's|$search_re|$replace_str|' $file}; | ||
### my $version = '1.8.4'; | ||
$search_re = qr/^my\s+\x24version\s+=\s+'$old_version';/; | ||
$replace_str = q|my \x24version = '| . $new_version . q|';|; | ||
system qq{perl -p -i -e "s|$search_re|$replace_str|" $file}; | ||
} | ||
} | ||
system qq{perl -p -i -e 's|$old_version|$new_version|' VERSION}; | ||
|
||
exit 0; |