]>
git.sthu.org Git - pgp-tools.git/blob - gpgdir/bump_version.pl
3 #############################################################################
5 # File: bump_version.pl
7 # Purpose: Minor script to enforce consistency in gpgdir version tags.
9 #############################################################################
11 # $Id: bump_version.pl 1055 2008-05-21 02:57:17Z mbr $
21 my $new_version = $ARGV[0] or die "[*] $0 <new version>";
23 open F
, '< VERSION' or die "[*] Could not open VERSION file: $!";
24 my $old_version = <F
>;
28 print "[+] Updating software versions...\n";
29 for my $file (@files) {
31 ###* Version: 1.8.4-pre2
32 my $search_re = qr/^\*\s+Version:\s+$old_version/;
33 my $replace_str = '* Version: ' . $new_version;
34 system qq{perl
-p
-i
-e
's|$search_re|} .
35 qq{$replace_str|' $file};
38 my $search_re = qr/#\s+Version:\s+$old_version/;
39 my $replace_str = '# Version: ' . $new_version;
40 system qq{perl
-p
-i
-e
's|$search_re|$replace_str|' $file};
41 ### my $version = '1.8.4';
42 $search_re = qr/^my\s+\x24version\s+=\s+'$old_version';/;
43 $replace_str = q
|my \x24version
= '| . $new_version . q|';|;
44 system qq{perl
-p
-i
-e
"s|$search_re|$replace_str|" $file};
47 system qq{perl
-p
-i
-e
's|$old_version|$new_version|' VERSION
};