From: Paul Ramsey Date: Mon, 16 Nov 2009 19:52:58 +0000 (+0000) Subject: Make POSTGIS_SCRIPTS_VERSION reflect the maximum SVN version of the SQL input files... X-Git-Tag: 1.5.0b1~225 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88301cc4d4225c3ce05536fe111c021a19f69194;p=postgis Make POSTGIS_SCRIPTS_VERSION reflect the maximum SVN version of the SQL input files. (#242) git-svn-id: http://svn.osgeo.org/postgis/trunk@4837 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/configure.ac b/configure.ac index 92f721c80..57b15407f 100644 --- a/configure.ac +++ b/configure.ac @@ -572,7 +572,8 @@ dnl POSTGIS_VERSION="$POSTGIS_MAJOR_VERSION.$POSTGIS_MINOR_VERSION USE_GEOS=1 USE_PROJ=1 USE_STATS=1" POSTGIS_LIB_VERSION="$POSTGIS_MAJOR_VERSION.$POSTGIS_MINOR_VERSION.$POSTGIS_MICRO_VERSION" POSTGIS_BUILD_DATE=`date -u "+%Y-%m-%d %H:%M:%S"` -POSTGIS_SCRIPTS_VERSION="$POSTGIS_LIB_VERSION" +POSTGIS_SCRIPTS_SVNREV=`perl utils/read_scripts_version.pl` +POSTGIS_SCRIPTS_VERSION="$POSTGIS_LIB_VERSION-$POSTGIS_SCRIPTS_SVNREV" AC_DEFINE_UNQUOTED([POSTGIS_VERSION], ["$POSTGIS_VERSION"], [PostGIS version]) AC_DEFINE_UNQUOTED([POSTGIS_LIB_VERSION], ["$POSTGIS_LIB_VERSION"], [PostGIS library version]) diff --git a/utils/read_scripts_version.pl b/utils/read_scripts_version.pl index 5dfde7066..57af6bce7 100644 --- a/utils/read_scripts_version.pl +++ b/utils/read_scripts_version.pl @@ -1,36 +1,38 @@ #!/usr/bin/perl -$url = "http://svn.osgeo.org/postgis/"; +my $debug = 0; -if ( $ARGV[1] ) -{ - $url .= "branches/" . $ARGV[1] . "/postgis/"; - print "Reading scripts version from branch $ARGV[1] ...\n"; -} -else -{ - $url .= "trunk/postgis/"; - print "Reading scripts version from trunk ...\n"; -} - -@files = ( - "postgis.sql.in.c", - "geography.sql.in.c", - "sqlmm.sql.in.c", - "long_xact.sql.in.c" - ); +my @files = ( + "postgis.sql.in.c", + "geography.sql.in.c", + "sqlmm.sql.in.c", + "long_xact.sql.in.c" + ); -$rev = 0; +my $rev = 0; foreach $f (@files) { - $uf = $url . $f; - $s = `svn info $uf`; - ($r) = ($s =~ /Last Changed Rev: (\d+)/); - print $uf," (Revision $r)\n"; - $rev = $r if $r > $rev; + my $file = "./postgis/$f"; + if( -f $file ) + { + my $r = 0; + open(F, $file); + while() + { + $r = $1 if /\$Id: \S+ (\d+) /; + } + print "$f got revision $r\n" if $debug && $r; + $rev = $r if $r > $rev; + } + else + { + die "Could not open input file $f\n"; + } } -print "\nScripts revision: $rev\n\n"; +print "\nMaximum scripts revision: $rev\n\n" if $debug; + +print $rev if ! $debug;