From: Paul Ramsey Date: Fri, 10 Feb 2012 20:21:51 +0000 (+0000) Subject: Back out SVN generation stuff. X-Git-Tag: 2.0.0alpha5~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c8cd388dafb09a6c192d86a24b4f4f0c815edce6;p=postgis Back out SVN generation stuff. git-svn-id: http://svn.osgeo.org/postgis/trunk@9151 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/GNUmakefile.in b/GNUmakefile.in index 217ff0af2..2fdf77bd4 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -19,7 +19,7 @@ all install uninstall noop clean distclean check: echo "PostGIS was built successfully. Ready to install."; \ fi -all: svnrevision.h +all: install: all @@ -178,9 +178,6 @@ authors.git: authors.svn svnrebase: authors.git git svn rebase --authors-file authors.git -svnrevision.h: .FORCE - $(PERL) utils/svn_repo_revision.pl - .PHONY: utils liblwgeom ChangeLog.svn raster .FORCE: diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c index 31ed0793c..4883cb7d6 100644 --- a/postgis/lwgeom_functions_basic.c +++ b/postgis/lwgeom_functions_basic.c @@ -36,7 +36,6 @@ Datum postgis_autocache_bbox(PG_FUNCTION_ARGS); Datum postgis_scripts_released(PG_FUNCTION_ARGS); Datum postgis_version(PG_FUNCTION_ARGS); Datum postgis_lib_version(PG_FUNCTION_ARGS); -Datum postgis_svn_version(PG_FUNCTION_ARGS); Datum postgis_libxml_version(PG_FUNCTION_ARGS); Datum postgis_lib_build_date(PG_FUNCTION_ARGS); Datum LWGEOM_length2d_linestring(PG_FUNCTION_ARGS); @@ -146,16 +145,6 @@ Datum postgis_lib_version(PG_FUNCTION_ARGS) PG_RETURN_TEXT_P(result); } -PG_FUNCTION_INFO_V1(postgis_svn_version); -Datum postgis_svn_version(PG_FUNCTION_ARGS) -{ - text *result; - char ver[256]; - snprintf(ver, 256, "%d", SVNREV); - result = cstring2text(ver); - PG_RETURN_TEXT_P(result); -} - PG_FUNCTION_INFO_V1(postgis_lib_build_date); Datum postgis_lib_build_date(PG_FUNCTION_ARGS) { @@ -167,10 +156,8 @@ Datum postgis_lib_build_date(PG_FUNCTION_ARGS) PG_FUNCTION_INFO_V1(postgis_scripts_released); Datum postgis_scripts_released(PG_FUNCTION_ARGS) { - char ver[256]; - text *result; - snprintf(ver, 256, "%s.%s r%d", POSTGIS_MAJOR_VERSION, POSTGIS_MINOR_VERSION, SVNREV); - result = cstring2text(ver); + char *ver = POSTGIS_SCRIPTS_VERSION; + text *result = cstring2text(ver); PG_RETURN_TEXT_P(result); } diff --git a/postgis/postgis.sql.in.c b/postgis/postgis.sql.in.c index a4bcaab90..5f80804ba 100644 --- a/postgis/postgis.sql.in.c +++ b/postgis/postgis.sql.in.c @@ -2302,10 +2302,6 @@ CREATE OR REPLACE FUNCTION postgis_lib_version() RETURNS text AS 'MODULE_PATHNAME' LANGUAGE 'C' IMMUTABLE; -- a new lib will require a new session -CREATE OR REPLACE FUNCTION postgis_svn_version() RETURNS text - AS 'MODULE_PATHNAME' - LANGUAGE 'C' IMMUTABLE; - -- NOTE: starting at 1.1.0 this is the same of postgis_lib_version() CREATE OR REPLACE FUNCTION postgis_scripts_released() RETURNS text AS 'MODULE_PATHNAME' @@ -2359,7 +2355,6 @@ BEGIN SELECT postgis_uses_stats() INTO usestats; SELECT postgis_scripts_installed() INTO dbproc; SELECT postgis_scripts_released() INTO relproc; - SELECT postgis_svn_version() INTO svnver; fullver = 'POSTGIS="' || libver || '"'; @@ -2379,10 +2374,6 @@ BEGIN fullver = fullver || ' LIBXML="' || libxmlver || '"'; END IF; - IF svnver IS NOT NULL THEN - fullver = fullver || ' SVN_REVISION=' || svnver; - END IF; - IF usestats THEN fullver = fullver || ' USE_STATS'; END IF; diff --git a/postgis_config.h.in b/postgis_config.h.in index cff57a693..59193191d 100644 --- a/postgis_config.h.in +++ b/postgis_config.h.in @@ -1,7 +1,5 @@ /* postgis_config.h.in. Generated from configure.ac by autoheader. */ -#include "svnrevision.h" - /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS diff --git a/utils/read_scripts_version.pl b/utils/read_scripts_version.pl index e7cb65167..e9dab74a9 100644 --- a/utils/read_scripts_version.pl +++ b/utils/read_scripts_version.pl @@ -1,39 +1,37 @@ #!/usr/bin/perl -$ENV{"LC_ALL"} = "C"; +my $debug = 0; + +my @files = ( + "postgis.sql.in.c", + "geography.sql.in.c", + "long_xact.sql.in.c" + ); -use Cwd; -my $cwd = &Cwd::cwd(); -my $svn_exe = `which svn`; my $rev = 0; -# We have a repo and can read from it -if ( $svn_exe && -d ".svn" ) { - my $svn_info; - $svn_info = `svn info`; - - if ( $svn_info =~ /Last Changed Rev: (\d+)/ ) { - $rev = $1; - open(OUT,">$cwd/svnrevision.h"); - print OUT "#define SVNREV $rev\n"; - close(OUT); - } - else { - die "Unable to find revision in svn info\n"; - } -} -# No repo, but there's a version file in the tarball -elsif ( -f "svnrevision.h" ) { - my $svn_revision_file = `cat svnrevision.h`; - if ( $svn_revision_file =~ /SVNREV (\d+)/ ) { - $rev = $1; - } - else { - die "svnrevision.h has an unexpected format\n"; - } -} -else { - die "Unable read svnrevision.h or svn repository metadata\n"; +foreach $f (@files) +{ + 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 $rev; +print "\nMaximum scripts revision: $rev\n\n" if $debug; + +print $rev if ! $debug; + +