Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 49 lines (42 sloc) 1.444 kB
7680f6d @mrash added bump_version.pl file
authored
1 #!/usr/bin/perl -w
2 #
3 #############################################################################
4 #
5 # File: bump_version.pl
6 #
7 # Purpose: Minor script to enforce consistency in fwsnort version tags.
8 #
9 #############################################################################
10 #
11 # $Id: bump_version.pl 1055 2008-05-21 02:57:17Z mbr $
12 #
13
14 use strict;
15
16 my @files = qw(
17 fwsnort
18 );
19
20 my $new_version = $ARGV[0] or die "[*] $0 <new version>";
21
22 open F, '< VERSION' or die "[*] Could not open VERSION file: $!";
23 my $old_version = <F>;
24 close F;
25 chomp $old_version;
26
27 print "[+] Updating software versions...\n";
28 for my $file (@files) {
29 if ($file =~ /\.c/) {
30 ###* Version: 1.8.4-pre2
31 my $search_re = qr/^\*\s+Version:\s+$old_version/;
32 my $replace_str = '* Version: ' . $new_version;
33 system qq{perl -p -i -e 's|$search_re|} .
34 qq{$replace_str|' $file};
35 } else {
36 ### Version: 1.8.4
37 my $search_re = qr/#\s+Version:\s+$old_version/;
38 my $replace_str = '# Version: ' . $new_version;
39 system qq{perl -p -i -e 's|$search_re|$replace_str|' $file};
40 ### my $version = '1.8.4';
41 $search_re = qr/^my\s+\x24version\s+=\s+'$old_version';/;
42 $replace_str = q|my \x24version = '| . $new_version . q|';|;
43 system qq{perl -p -i -e "s|$search_re|$replace_str|" $file};
44 }
45 }
46 system qq{perl -p -i -e 's|$old_version|$new_version|' VERSION};
47
48 exit 0;
Something went wrong with that request. Please try again.