Skip to content
Snippets Groups Projects
Select Git revision
  • 2a4a1496241d6c4183763f90600be4775ccb5470
  • master default protected
  • maint-0.4.3
  • maint-0.4.4
  • maint-0.4.5
  • release-0.3.5
  • release-0.4.3
  • release-0.4.4
  • release-0.4.5
  • maint-0.3.5
  • maint-0.4.2
  • release-0.4.2
  • maint-0.4.1
  • release-0.4.1
  • maint-0.4.0
  • release-0.4.0
  • release-0.2.9
  • maint-0.2.9
  • release-0.3.4
  • maint-0.3.4
  • release-0.3.3
  • tor-0.4.5.3-rc
  • tor-0.4.5.2-alpha
  • tor-0.4.6.0-alpha-dev
  • tor-0.3.5.12
  • tor-0.4.3.7
  • tor-0.4.4.6
  • tor-0.4.5.1-alpha
  • tor-0.4.4.5
  • tor-0.4.4.4-rc
  • tor-0.4.4.3-alpha
  • tor-0.4.4.2-alpha
  • tor-0.4.3.6
  • tor-0.4.2.8
  • tor-0.3.5.11
  • tor-0.4.4.1-alpha
  • tor-0.4.4.0-alpha-dev
  • tor-0.4.5.0-alpha-dev
  • tor-0.4.3.5
  • tor-0.4.3.4-rc
  • tor-0.4.3.3-alpha
41 results

updateVersions.pl

Blame
  • Forked from The Tor Project / Core / Tor
    23947 commits behind the upstream repository.
    user avatar
    Stewart Smith authored and Nick Mathewson committed
    This gives us a few benefits:
    1) make -j clean all
       this will start working, as it should. It currently doesn't.
    2) increased parallel build
       recursive make will max out at number of files in a directory,
       non-recursive make doesn't have such a limitation
    3) Removal of duplicate information in make files,
       less error prone
    
    I've also slightly updated how we call AM_INIT_AUTOMAKE, as the way
    that was used was not only deprecated but will be *removed* in the next
    major automake release (1.13).... so probably best that we can continue
    to bulid tor without requiring old automake.
    (see http://www.gnu.org/software/automake/manual/html_node/Public-Macros.html )
    
    For more reasons  why, see resources such as:
    http://miller.emu.id.au/pmiller/books/rmch/
    2a4a1496
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    updateVersions.pl 1.27 KiB
    #!/usr/bin/perl -w
    
    $CONFIGURE_IN = './configure.in';
    $ORCONFIG_H = './src/win32/orconfig.h';
    $TOR_NSI = './contrib/tor-mingw.nsi.in';
    
    sub demand {
        my $fn = shift;
        die "Missing file $fn" unless (-f $fn);
    }
    
    demand($CONFIGURE_IN);
    demand($ORCONFIG_H);
    demand($TOR_NSI);
    
    # extract version from configure.in
    
    open(F, $CONFIGURE_IN) or die "$!";
    $version = undef;
    while (<F>) {
        if (/AC_INIT\(\[tor\],\s*\[([^\]]*)\]\)/) {
    	$version = $1;
    	last;
        }
    }
    die "No version found" unless $version;
    print "Tor version is $version\n";
    close F;
    
    sub correctversion {
        my ($fn, $defchar) = @_;
        undef $/;
        open(F, $fn) or die "$!";
        my $s = <F>;
        close F;
        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";
    	    $line = $defchar . "define VERSION \"$version\"";
    	    open(F, ">$fn.bak");
    	    print F $s;
    	    close F;
    	    $s =~ s/^$defchar(?:)define\s+VERSION.*?$/$line/m;
    	    open(F, ">$fn");
    	    print F $s;
    	    close F;	    
    	} else {
    	    print "$fn has the correct version. Good.\n";
    	}
        } else {
    	print "Didn't find a version line in $fn -- uh oh.\n";
        }
    }
    
    correctversion($TOR_NSI, "!");
    correctversion($ORCONFIG_H, "#");