aboutsummaryrefslogtreecommitdiff
path: root/contrib/updateVersions.pl
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/updateVersions.pl')
-rwxr-xr-xcontrib/updateVersions.pl16
1 files changed, 9 insertions, 7 deletions
diff --git a/contrib/updateVersions.pl b/contrib/updateVersions.pl
index 76b6fe567..9dae1ff95 100755
--- a/contrib/updateVersions.pl
+++ b/contrib/updateVersions.pl
@@ -1,9 +1,11 @@
#!/usr/bin/perl -w
-$CONFIGURE_IN = './configure.in';
+$CONFIGURE_IN = './configure.ac';
$ORCONFIG_H = './src/win32/orconfig.h';
$TOR_NSI = './contrib/tor-mingw.nsi.in';
+$quiet = 1;
+
sub demand {
my $fn = shift;
die "Missing file $fn" unless (-f $fn);
@@ -13,18 +15,18 @@ demand($CONFIGURE_IN);
demand($ORCONFIG_H);
demand($TOR_NSI);
-# extract version from configure.in
+# extract version from configure.ac
open(F, $CONFIGURE_IN) or die "$!";
$version = undef;
while (<F>) {
- if (/AM_INIT_AUTOMAKE\(tor,\s*([^\)]*)\)/) {
+ if (/AC_INIT\(\[tor\],\s*\[([^\]]*)\]\)/) {
$version = $1;
last;
}
}
die "No version found" unless $version;
-print "Tor version is $version\n";
+print "Tor version is $version\n" unless $quiet;
close F;
sub correctversion {
@@ -36,7 +38,7 @@ sub correctversion {
if ($s =~ /^$defchar(?:)define\s+VERSION\s+\"([^\"]+)\"/m) {
$oldver = $1;
if ($oldver ne $version) {
- print "Version mismatch in $fn: It thinks that the version is $oldver. Fixing.\n";
+ print "Version mismatch in $fn: It thinks that the version is $oldver. I think it's $version. Fixing.\n";
$line = $defchar . "define VERSION \"$version\"";
open(F, ">$fn.bak");
print F $s;
@@ -44,9 +46,9 @@ sub correctversion {
$s =~ s/^$defchar(?:)define\s+VERSION.*?$/$line/m;
open(F, ">$fn");
print F $s;
- close F;
+ close F;
} else {
- print "$fn has the correct version. Good.\n";
+ print "$fn has the correct version. Good.\n" unless $quiet;
}
} else {
print "Didn't find a version line in $fn -- uh oh.\n";