diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-06-27 19:16:56 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-06-27 19:16:56 +0000 |
commit | a2f458359da4b9078a495952544390e03c132164 (patch) | |
tree | e538854f7fa7dfe9bbbb749ca3eeb859b37bfa88 /infrastructure | |
parent | 00ed2553cf50ecc56631ca9133a926d2b488ed04 (diff) |
Handle USE_SVN_VERSION in distribution VERSION files.
Diffstat (limited to 'infrastructure')
-rwxr-xr-x | infrastructure/makedistribution.pl.in | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/infrastructure/makedistribution.pl.in b/infrastructure/makedistribution.pl.in index 52e1c2e4..d2c29660 100755 --- a/infrastructure/makedistribution.pl.in +++ b/infrastructure/makedistribution.pl.in @@ -1,3 +1,4 @@ +#!/usr/bin/perl #!@PERL@ use strict; use Symbol; @@ -36,6 +37,29 @@ close VERSION; die "Archive name '$archive_name' is not equal to the distribution name '$distribution'" unless $archive_name eq $distribution; +my $svnversion = `svnversion .`; +chomp $svnversion; +$svnversion =~ tr/0-9A-Za-z/_/c; + +if($version =~ /USE_SVN_VERSION/) +{ + # for developers, use SVN version + open INFO,'svn info . |'; + my $svnurl; + while(<INFO>) + { + if(m/^URL: (.+?)[\n\r]+/) + { + $svnurl = $1; + } + } + close INFO; + $svnurl =~ m'box/(.+)$'; + my $svndir = $1; + $svndir =~ tr/0-9A-Za-z/_/c; + $version =~ s/USE_SVN_VERSION/$svndir.'_'.$svnversion/e; +} + # make initial directory my $base_name = "$archive_name-$version"; system "rm -rf $base_name"; @@ -47,8 +71,6 @@ open LICENSE,"$dist_root/LICENSE.txt" or die "Can't open $dist_root/LICENSE.txt" my $license_f; read LICENSE,$license_f,100000; close LICENSE; -my $svnversion = `svnversion .`; -chomp $svnversion; my @license = ('distribution '.$base_name.' (svn version: '.$svnversion.')',split(/\n/,$license_f)); # copy files, make a note of all the modules included |