]> granicus.if.org Git - postgis/commitdiff
Back out SVN generation stuff.
authorPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 10 Feb 2012 20:21:51 +0000 (20:21 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 10 Feb 2012 20:21:51 +0000 (20:21 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9151 b70326c6-7e19-0410-871a-916f4a2858ee

GNUmakefile.in
postgis/lwgeom_functions_basic.c
postgis/postgis.sql.in.c
postgis_config.h.in
utils/read_scripts_version.pl

index 217ff0af24de82d6c16a3f69fea72cc727ac0715..2fdf77bd4524028b5c3e63edd94686ee2efd80d2 100644 (file)
@@ -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:
index 31ed0793cf50439faf0a74ef3003e6843e56a09a..4883cb7d63d1cb16c29669ca4da9eb687304dd7f 100644 (file)
@@ -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);
 }
 
index a4bcaab9008ff88f408b23265c1a2216a0504f16..5f80804ba265ca61853eeabb0ef007f8bde6c490 100644 (file)
@@ -2302,10 +2302,6 @@ CREATE OR REPLACE FUNCTION postgis_lib_version() RETURNS text
        AS 'MODULE_PATHNAME'\r
        LANGUAGE 'C' IMMUTABLE; -- a new lib will require a new session\r
 \r
-CREATE OR REPLACE FUNCTION postgis_svn_version() RETURNS text\r
-       AS 'MODULE_PATHNAME'\r
-       LANGUAGE 'C' IMMUTABLE;\r
-\r
 -- NOTE: starting at 1.1.0 this is the same of postgis_lib_version()\r
 CREATE OR REPLACE FUNCTION postgis_scripts_released() RETURNS text\r
        AS 'MODULE_PATHNAME'\r
@@ -2359,7 +2355,6 @@ BEGIN
        SELECT postgis_uses_stats() INTO usestats;\r
        SELECT postgis_scripts_installed() INTO dbproc;\r
        SELECT postgis_scripts_released() INTO relproc;\r
-       SELECT postgis_svn_version() INTO svnver;\r
 \r
        fullver = 'POSTGIS="' || libver || '"';\r
 \r
@@ -2379,10 +2374,6 @@ BEGIN
                fullver = fullver || ' LIBXML="' || libxmlver || '"';\r
        END IF;\r
        \r
-       IF  svnver IS NOT NULL THEN\r
-               fullver = fullver || ' SVN_REVISION=' || svnver;\r
-       END IF;\r
-\r
        IF usestats THEN\r
                fullver = fullver || ' USE_STATS';\r
        END IF;\r
index cff57a6934dd4f7618e82018dc5f48b1e246b1d2..59193191da4c6e7e5d8849abe93d579e87c29090 100644 (file)
@@ -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
index e7cb65167f979b3836f61e7a7e90a8e87231b7e5..e9dab74a94dd623e7a22df9e6ec11a99515d34d6 100644 (file)
@@ -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(<F>)
+               {
+                       $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;
+
+