3 $CONFIGURE_IN = './configure.ac';
4 $ORCONFIG_H = './src/win32/orconfig.h';
5 $TOR_NSI = './contrib/tor-mingw.nsi.in';
11 die "Missing file $fn" unless (-f
$fn);
14 demand
($CONFIGURE_IN);
18 # extract version from configure.ac
20 open(F
, $CONFIGURE_IN) or die "$!";
23 if (/AC_INIT\(\[tor\],\s*\[([^\]]*)\]\)/) {
28 die "No version found" unless $version;
29 print "Tor version is $version\n" unless $quiet;
33 my ($fn, $defchar) = @_;
35 open(F
, $fn) or die "$!";
38 if ($s =~ /^$defchar(?:)define\s+VERSION\s+\"([^\"]+)\"/m) {
40 if ($oldver ne $version) {
41 print "Version mismatch in $fn: It thinks that the version is $oldver. I think it's $version. Fixing.\n";
42 $line = $defchar . "define VERSION \"$version\"";
46 $s =~ s/^$defchar(?:)define\s+VERSION.*?$/$line/m;
51 print "$fn has the correct version. Good.\n" unless $quiet;
54 print "Didn't find a version line in $fn -- uh oh.\n";
58 correctversion
($TOR_NSI, "!");
59 correctversion
($ORCONFIG_H, "#");