[postgis-tickets] [SCM] PostGIS; Spatial objects for PostgreSQL. branch master updated. 188c3573e7fc1911c7dbec65dd5987beec716f2a

git at osgeo.org git at osgeo.org
Tue Oct 29 03:43:49 PDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS; Spatial objects for PostgreSQL.".

The branch, master has been updated
       via  188c3573e7fc1911c7dbec65dd5987beec716f2a (commit)
       via  4c128c9f0a7c20c5e55c09890df4927ec3657552 (commit)
      from  e6a5f6cf2334a7936f220fccd7761c3521a0bc6d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 188c3573e7fc1911c7dbec65dd5987beec716f2a
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Oct 29 11:43:26 2019 +0100

    Drop authors.git, not more needed

diff --git a/GNUmakefile.in b/GNUmakefile.in
index 96d3097..9aba0d0 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -169,12 +169,6 @@ fmt:
 commit:
 	$(MAKE) fmt && $(MAKE) clean && $(MAKE) check && svn commit
 
-authors.git: authors.svn
-	sed -e 's/:/ = /' authors.svn > authors.git
-
-svnrebase: authors.git
-	git svn rebase --authors-file authors.git
-
 postgis_revision.h:
 	$(PERL) utils/repo_revision.pl
 
diff --git a/authors.git b/authors.git
deleted file mode 100644
index 6dd0d75..0000000
--- a/authors.git
+++ /dev/null
@@ -1,33 +0,0 @@
-algunenano = Raúl Marín Rodríguez <rmrodriguez at carto.com>
-benjubb = Ben Jubb <benjubb at refractions.net>
-bergun = Baris Ergun <barisergun75 at gmail.com>
-bjornharrtell = Björn Harrtell <bjorn at wololo.org>
-chodgson = Chris Hodgson <chodgson at refractions.net>
-colivier = Olivier Courtin <olivier.courtin at oslandia.com>
-cvs = No Body <no at body.net>
-dbaston = Daniel Baston <dbaston at gmail.com>
-dblasby = David Blasby <dblasby at gmail.com>
-devrim = Devrim GÜNDÜZ <devrim at gunduz.org>
-dustymugs = Bborie Park <dustymugs at gmail.com>
-dzwarg = David Zwarg <dzwarg at azavea.com>
-jeffloun = Jeff Lounsbury <jeffloun at refractions.net>
-jorgearevalo = Jorge Arévalo <jorge.arevalo at deimos-space.com>
-kneufeld = Kevin Neufeld <kneufeld.ca at gmail.com>
-komzpa = Darafei Praliaskouski <me at komzpa.net>
-mcayland = Mark Cave-Ayland <mark.cave-ayland at siriusit.co.uk>
-mdavis = Martin Davis <mtnclimb at gmail.com>
-mleslie = Mark Leslie <mark.s.leslie at gmail.com>
-mloskot = Mateusz Loskot <mateusz at loskot.net>
-mschaber = Markus Schaber <markus at schabi.de>
-nbarker = Norman Barker <nbarker at ittvis.com>
-nicklas = Nicklas Avén <nicklas.aven at jordogskog.no>
-pracine = Pierre Racine <Pierre.Racine at sbf.ulaval.ca>
-pramsey = Paul Ramsey <pramsey at cleverelephant.ca>
-rmason = Ralph Mason <ralph.mason at telogis.com>
-robe = Regina Obe <lr at pcorp.us>
-snowman = Stephen Frost <sfrost at snowman.net>
-strk = Sandro Santilli <strk at kbt.io>
-warmerdam = Frank Warmerdam <warmerdam at pobox.com>
-woodbri = Stephen Woodbridge <woodbri at swoodbridge.com>
-xingkth = Xing Lin <solo.lin at gmail.com>
-yecarrillo = Eduin Carrillo <yecarrillo at yahoo.com>

commit 4c128c9f0a7c20c5e55c09890df4927ec3657552
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Oct 29 11:27:40 2019 +0100

    Fix postgis revision string to be output of `git describe --always`
    
    Also rename POSTGIS_SVN_REVISION macro to POSTGIS_REVISION and fix
    code accordingly.

diff --git a/liblwgeom/lwgeom_api.c b/liblwgeom/lwgeom_api.c
index 161060e..64b74c9 100644
--- a/liblwgeom/lwgeom_api.c
+++ b/liblwgeom/lwgeom_api.c
@@ -32,6 +32,9 @@
 #include <assert.h>
 #include "../postgis_revision.h"
 
+#define xstr(s) str(s)
+#define str(s) #s
+
 const char *
 lwgeom_version()
 {
@@ -40,7 +43,7 @@ lwgeom_version()
   if ( ! ptr )
   {
     ptr = buf;
-    snprintf(ptr, 256, LIBLWGEOM_VERSION" r%d", POSTGIS_SVN_REVISION);
+    snprintf(ptr, 256, LIBLWGEOM_VERSION" " xstr(POSTGIS_REVISION));
   }
 
   return ptr;
diff --git a/loader/pgsql2shp-cli.c b/loader/pgsql2shp-cli.c
index 7c5c064..803f0c2 100644
--- a/loader/pgsql2shp-cli.c
+++ b/loader/pgsql2shp-cli.c
@@ -19,13 +19,16 @@
 #include "pgsql2shp-core.h"
 #include "../postgis_config.h"
 
+#define xstr(s) str(s)
+#define str(s) #s
 
 static void
 usage(int status)
 {
   /* TODO: if status != 0 print all to stderr */
 
-	printf(_( "RELEASE: %s (r%d)\n" ), POSTGIS_LIB_VERSION, POSTGIS_SVN_REVISION);
+	printf(_( "RELEASE: %s (%s)\n" ), POSTGIS_LIB_VERSION,
+		xstr(POSTGIS_REVISION));
 	printf(_("USAGE: pgsql2shp [<options>] <database> [<schema>.]<table>\n"
 	         "       pgsql2shp [<options>] <database> <query>\n"
 	         "\n"
diff --git a/loader/shp2pgsql-cli.c b/loader/shp2pgsql-cli.c
index 8ab1214..efaae13 100644
--- a/loader/shp2pgsql-cli.c
+++ b/loader/shp2pgsql-cli.c
@@ -17,10 +17,14 @@
 #include "shp2pgsql-core.h"
 #include "../liblwgeom/liblwgeom.h" /* for SRID_UNKNOWN */
 
+#define xstr(s) str(s)
+#define str(s) #s
+
 static void
 usage()
 {
-	printf(_( "RELEASE: %s (r%d)\n" ), POSTGIS_LIB_VERSION, POSTGIS_SVN_REVISION);
+	printf(_( "RELEASE: %s (%s)\n" ),
+		POSTGIS_LIB_VERSION, xstr(POSTGIS_REVISION));
 	printf(_( "USAGE: shp2pgsql [<options>] <shapefile> [[<schema>.]<table>]\n"
 	          "OPTIONS:\n" ));
 	printf(_( "  -s [<from>:]<srid> Set the SRID field. Defaults to %d.\n"
diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c
index acc84cc..adc6d3f 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -39,6 +39,9 @@
 #include <string.h>
 #include <stdio.h>
 
+#define xstr(s) str(s)
+#define str(s) #s
+
 Datum LWGEOM_mem_size(PG_FUNCTION_ARGS);
 Datum LWGEOM_summary(PG_FUNCTION_ARGS);
 Datum LWGEOM_npoints(PG_FUNCTION_ARGS);
@@ -198,15 +201,15 @@ Datum postgis_svn_version(PG_FUNCTION_ARGS)
 PG_FUNCTION_INFO_V1(postgis_lib_revision);
 Datum postgis_lib_revision(PG_FUNCTION_ARGS)
 {
-	static int rev = POSTGIS_SVN_REVISION;
+	static char *rev = xstr(POSTGIS_REVISION);
 	char ver[32];
-	if (rev > 0)
+	if (rev && rev[0] != '\0')
 	{
-		snprintf(ver, 32, "%d", rev);
+		snprintf(ver, 32, "%s", rev);
+		ver[31] = '\0';
 		PG_RETURN_TEXT_P(cstring_to_text(ver));
 	}
-	else
-		PG_RETURN_NULL();
+	else PG_RETURN_NULL();
 }
 
 PG_FUNCTION_INFO_V1(postgis_lib_build_date);
@@ -223,7 +226,7 @@ Datum postgis_scripts_released(PG_FUNCTION_ARGS)
 	char ver[64];
 	text *result;
 
-	snprintf(ver, 64, "%s r%d", POSTGIS_LIB_VERSION, POSTGIS_SVN_REVISION);
+	snprintf(ver, 64, "%s %s", POSTGIS_LIB_VERSION, xstr(POSTGIS_REVISION));
 	ver[63] = '\0';
 
 	result = cstring_to_text(ver);
diff --git a/postgis/sqldefines.h.in b/postgis/sqldefines.h.in
index 058b2b1..95654a8 100644
--- a/postgis/sqldefines.h.in
+++ b/postgis/sqldefines.h.in
@@ -50,8 +50,8 @@
 #define _POSTGIS_SQL_SELECT_POSTGIS_BUILD_DATE 'SELECT ''@POSTGIS_BUILD_DATE@''::text AS version'
 #define _POSTGIS_SQL_SELECT_POSTGIS_PGSQL_VERSION 'SELECT ''@POSTGIS_PGSQL_VERSION@''::text AS version'
 
-#ifdef POSTGIS_SVN_REVISION
-#define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION $$ SELECT '@POSTGIS_SCRIPTS_VERSION@'::text || ' r' || POSTGIS_SVN_REVISION::text AS version $$
+#ifdef POSTGIS_REVISION
+#define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION $$ SELECT '@POSTGIS_SCRIPTS_VERSION@'::text || $rev$ POSTGIS_REVISION$rev$::text AS version $$
 #else
 #define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION $$ SELECT '@POSTGIS_SCRIPTS_VERSION@'::text AS version $$
 #endif
diff --git a/raster/loader/raster2pgsql.c b/raster/loader/raster2pgsql.c
index 1b1199c..e7317c1 100644
--- a/raster/loader/raster2pgsql.c
+++ b/raster/loader/raster2pgsql.c
@@ -30,6 +30,9 @@
 #include "ogr_srs_api.h"
 #include <assert.h>
 
+#define xstr(s) str(s)
+#define str(s) #s
+
 static void
 loader_rt_error_handler(const char *fmt, va_list ap) {
 	static const char *label = "ERROR: ";
@@ -325,7 +328,7 @@ chartrim(const char *input, char *remove) {
 
 static void
 usage() {
-	printf(_("RELEASE: %s GDAL_VERSION=%d (r%d)\n"), POSTGIS_LIB_VERSION, POSTGIS_GDAL_VERSION, POSTGIS_SVN_REVISION);
+	printf(_("RELEASE: %s GDAL_VERSION=%d (%s)\n"), POSTGIS_LIB_VERSION, POSTGIS_GDAL_VERSION, xstr(POSTGIS_REVISION));
 	printf(_(
 		"USAGE: raster2pgsql [<options>] <raster>[ <raster>[ ...]] [[<schema>.]<table>]\n"
 		"  Multiple rasters can also be specified using wildcards (*,?).\n"
diff --git a/raster/rt_pg/rtpg_utility.c b/raster/rt_pg/rtpg_utility.c
index ef15dbb..017d265 100644
--- a/raster/rt_pg/rtpg_utility.c
+++ b/raster/rt_pg/rtpg_utility.c
@@ -34,6 +34,9 @@
 #include "../../postgis_config.h"
 #include "lwgeom_pg.h"
 
+#define xstr(s) str(s)
+#define str(s) #s
+
 #include "rtpostgis.h"
 
 Datum RASTER_lib_version(PG_FUNCTION_ARGS);
@@ -47,7 +50,7 @@ Datum RASTER_lib_version(PG_FUNCTION_ARGS)
     char ver[64];
     text *result;
 
-    snprintf(ver, 64, "%s r%d", POSTGIS_LIB_VERSION, POSTGIS_SVN_REVISION);
+    snprintf(ver, 64, "%s %s", POSTGIS_LIB_VERSION, xstr(POSTGIS_REVISION));
     ver[63] = '\0';
 
     result = cstring_to_text(ver);
diff --git a/utils/repo_revision.pl b/utils/repo_revision.pl
index bc092a7..9ee2597 100755
--- a/utils/repo_revision.pl
+++ b/utils/repo_revision.pl
@@ -12,10 +12,10 @@ my $target = 'local';
 $target = $ARGV[0] if $ARGV[0];
 
 # Read the svn revision number
-my $svn_rev = &read_rev($target);
+my $rev = &read_rev($target);
 
 # Write it
-&write_defn($svn_rev);
+&write_defn($rev);
 
 
 sub read_rev {
@@ -24,25 +24,7 @@ sub read_rev {
 
   #print STDERR "Target: $target\n";
 
-  my $svn_info;
-
-  if ( $target eq "local" ) {
-    if ( -d $top_srcdir."/.svn" ) {
-      #print STDERR "There's a ". $top_srcdir."/.svn dir\n";
-      $svn_info  = &read_rev_svn($target);
-    } elsif ( -e $top_srcdir."/.git" ) {
-      #print STDERR "There's a ". $top_srcdir."/.git dir\n";
-      $svn_info  = &read_rev_git();
-    } else {
-      print STDERR "Can't fetch local revision (neither .svn nor .git found)\n";
-      $svn_info = 0;
-    }
-  } else {
-    $svn_info  = &read_rev_svn($target);
-  }
-
-  return $svn_info;
-
+	return &read_rev_git();
 }
 
 sub read_rev_git {
@@ -53,18 +35,18 @@ sub read_rev_git {
   #
   my $git_exe = `which git`;
   if ( ! $git_exe ) {
-    print STDERR "Can't fetch SVN revision: no git executable found\n";
-    return 0;
+    print STDERR "Can't determine revision: no git executable found\n";
+    return "";
   }
   chop($git_exe);
 
-  my $cmd = "\"${git_exe}\" log --grep=git-svn -1 | grep git-svn | cut -d@ -f2 | cut -d' ' -f1";
+  my $cmd = "\"${git_exe}\" describe --always";
   #print STDERR "cmd: ${cmd}\n";
   my $rev  = `$cmd`;
 
   if ( ! $rev ) {
-    print STDERR "Can't fetch SVN revision from git log\n";
-    $rev = 0;
+    print STDERR "Can't determine revision from git log\n";
+    $rev = "";
   } else {
     chop($rev);
   }
@@ -72,40 +54,6 @@ sub read_rev_git {
   return $rev;
 }
 
-sub read_rev_svn {
-
-  my $target = shift;
-
-  # TODO: test on old systems, I think I saw some `which`
-  #       implementations returning "nothing found" or something
-  #       like that, making the later if ( ! $svn_exe ) always false
-  #
-  my $svn_exe = `which svn`;
-  if ( ! $svn_exe ) {
-    print STDERR "Can't fetch SVN revision: no svn executable found\n";
-    return 0;
-  }
-  chop($svn_exe);
-
-
-  my $svn_info;
-  if ( $target eq "local" ) {
-    $svn_info  = `"${svn_exe}" info`;
-  } else {
-    $svn_info  = `"${svn_exe}" info $target`;
-  }
-
-  my $rev;
-  if ( $svn_info =~ /Last Changed Rev: (\d+)/ ) {
-    $rev = $1;
-  } else {
-    print STDERR "Can't fetch SVN revision: no 'Loast Changed Rev' in `svn info` output\n";
-    $rev = 0;
-  }
-
-  return $rev;
-}
-
 sub write_defn {
   my $rev = shift;
   my $oldrev = 0;
@@ -115,17 +63,17 @@ sub write_defn {
   if ( -f $rev_file ) {
     open(IN, "<$rev_file");
     my $oldrevline = <IN>;
-    if ( $oldrevline =~ /POSTGIS_SVN_REVISION (.*)/ ) {
+    if ( $oldrevline =~ /POSTGIS_REVISION (.*)/ ) {
       $oldrev = $1;
     }
     close(IN);
-    if ( $rev == 0 or $rev == $oldrev ) {
+    if ( $rev eq "" or $rev eq $oldrev ) {
       print STDERR "Not updating existing rev file at $oldrev\n";
       return;
     }
   }
 
-  my $string = "#define POSTGIS_SVN_REVISION $rev\n";
+  my $string = "#define POSTGIS_REVISION $rev\n";
   open(OUT,">$rev_file");
   print OUT $string;
   close(OUT);

-----------------------------------------------------------------------

Summary of changes:
 GNUmakefile.in                   |  6 ----
 authors.git                      | 33 ------------------
 liblwgeom/lwgeom_api.c           |  5 ++-
 loader/pgsql2shp-cli.c           |  5 ++-
 loader/shp2pgsql-cli.c           |  6 +++-
 postgis/lwgeom_functions_basic.c | 15 ++++----
 postgis/sqldefines.h.in          |  4 +--
 raster/loader/raster2pgsql.c     |  5 ++-
 raster/rt_pg/rtpg_utility.c      |  5 ++-
 utils/repo_revision.pl           | 74 ++++++----------------------------------
 10 files changed, 43 insertions(+), 115 deletions(-)
 delete mode 100644 authors.git


hooks/post-receive
-- 
PostGIS; Spatial objects for PostgreSQL.


More information about the postgis-tickets mailing list