3 $CONFIGURE_IN = './configure.in';
4 $ORCONFIG_H = './src/win32/orconfig.h';
5 $TOR_NSI = './contrib/tor.nsi';
9 die "Missing file $fn" unless (-f
$fn);
12 demand
($CONFIGURE_IN);
16 # extract version from configure.in
18 open(F
, $CONFIGURE_IN) or die "$!";
21 if (/AM_INIT_AUTOMAKE\(tor,\s*([^\)]*)\)/) {
26 die "No version found" unless $version;
27 print "Tor version is $version\n";
31 my ($fn, $defchar) = @_;
33 open(F
, $fn) or die "$!";
36 if ($s =~ /^$defchar(?:)define\s+VERSION\s+\"([^\"]+)\"/m) {
38 if ($oldver ne $version) {
39 print "Version mismatch in $fn: It thinks that the version is $oldver. Fixing.\n";
40 $line = $defchar . "define VERSION \"$version\"";
44 $s =~ s/^$defchar(?:)define\s+VERSION.*?$/$line/m;
49 print "$fn has the correct version. Good.\n";
52 print "Didn't find a version line in $fn -- uh oh.\n";
56 correctversion
($TOR_NSI, "!");
57 correctversion
($ORCONFIG_H, "#");