[Git][debian-gis-team/pgsql-ogr-fdw][master] 10 commits: New upstream version 1.0.6

Bas Couwenberg gitlab at salsa.debian.org
Fri Jul 6 20:06:41 BST 2018


Bas Couwenberg pushed to branch master at Debian GIS Project / pgsql-ogr-fdw


Commits:
849f4f00 by Bas Couwenberg at 2018-07-06T19:42:27+02:00
New upstream version 1.0.6
- - - - -
146ffe71 by Bas Couwenberg at 2018-07-06T19:42:28+02:00
Merge tag 'upstream/1.0.6'

Upstream version 1.0.6

- - - - -
93f807de by Bas Couwenberg at 2018-07-06T19:43:02+02:00
New upstream release.

- - - - -
82673f39 by Bas Couwenberg at 2018-07-06T19:45:04+02:00
Update copyright file, add license & copyright for stringbuffer_pg.c.

- - - - -
c9463927 by Bas Couwenberg at 2018-07-06T19:51:42+02:00
Refresh patches.

- - - - -
d85bd584 by Bas Couwenberg at 2018-07-06T19:53:23+02:00
Revert "Strip trailing whitespace from control file."

This reverts commit 979902f08772a308d68c161a3fcfa2cd8c28fc6a.

- - - - -
296fdbca by Bas Couwenberg at 2018-07-06T20:07:12+02:00
Fix typo in patch description.

- - - - -
2f089213 by Bas Couwenberg at 2018-07-06T20:07:12+02:00
Enable all hardening buildflags.

- - - - -
8ff840ca by Bas Couwenberg at 2018-07-06T20:40:58+02:00
Add patch to use LDFLAGS for hardeningflags.

- - - - -
38c97d19 by Bas Couwenberg at 2018-07-06T20:40:58+02:00
Set distribution to unstable.

- - - - -


13 changed files:

- .travis.yml
- Makefile
- + ci/pg_hba.conf
- debian/changelog
- debian/control
- debian/copyright
- + debian/patches/hardingflags.patch
- debian/patches/install.patch
- debian/patches/series
- debian/rules
- ogr_fdw.c
- stringbuffer.c
- + stringbuffer_pg.c


Changes:

=====================================
.travis.yml
=====================================
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,59 +1,47 @@
+dist: trusty
 sudo: required
-
+language: cpp
 compiler: gcc
 
+addons:
+  apt:
+    packages:
+    - curl
+    - libcurl4-gnutls-dev
+    - ca-certificates
+    - software-properties-common 
+    - python-software-properties
+    - gnupg-curl
 
-matrix:
-  include:
-    - os: linux
-      language: c
-      env:
-        - GDAL_VERSION=11
-    - os: linux
-      language: cpp
-      env:
-        - GDAL_VERSION=20
-    - os: linux
-      language: cpp
-      env:
-        - GDAL_VERSION=21
-    - os: linux
-      language: cpp
-      env:
-        - GDAL_VERSION=22
+env:
+  - PG_VERSION=9.6 GDAL_VERSION=1.1
+  - PG_VERSION=9.6 GDAL_VERSION=2.2.4
+  - PG_VERSION=9.6 GDAL_VERSION=2.3.1
+  - PG_VERSION=10 GDAL_VERSION=2.3.1
 
 before_script:
   - sudo /etc/init.d/postgresql stop
-  - sudo apt-get -y remove --purge postgresql-9.1
-  - sudo apt-get -y remove --purge postgresql-9.2
-  - sudo apt-get -y remove --purge postgresql-9.3
-  - sudo apt-get -y remove --purge postgresql-9.4
+  - sudo apt-get -y --purge remove postgresql-9.1
+  - sudo apt-get -y --purge remove postgresql-9.2
+  - sudo apt-get -y --purge remove postgresql-9.3
+  - sudo apt-get -y --purge remove postgresql-9.4
+  - sudo apt-get -y --purge remove postgresql-9.5
+  - sudo apt-get -y --purge remove postgresql-9.6
   - sudo apt-get -y autoremove
-  - sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 7FCC7D46ACCC4CF8
-  - sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main 9.5" >> /etc/apt/sources.list.d/postgresql.list'
-  - sudo apt-get update
-  - sudo apt-get -y install postgresql-9.5 postgresql-server-dev-9.5
-  - sudo sh -c 'echo "local all all trust" > /etc/postgresql/9.5/main/pg_hba.conf'
-  - sudo sh -c 'echo -n "host all all 127.0.0.1/32 trust" >> /etc/postgresql/9.5/main/pg_hba.conf'
-  - sudo /etc/init.d/postgresql stop
-#  - sudo /etc/init.d/postgresql start
-#  - sudo apt-get install valgrind
-  - sudo -u postgres /usr/lib/postgresql/9.5/bin/postgres -D /var/lib/postgresql/9.5/main -c config_file=/etc/postgresql/9.5/main/postgresql.conf 2>/tmp/postgres.log &
-# Run the Postgres instance under Valgrind and collect Valgrind log
-#  - sudo -u postgres valgrind --trace-children=yes --leak-check=full /usr/lib/postgresql/9.5/bin/postgres -D /var/lib/postgresql/9.5/main -c config_file=/etc/postgresql/9.5/main/postgresql.conf 2>/tmp/postgres.log &
-  - psql --version
-  - if test "$GDAL_VERSION" = "11"; then sudo apt-get install libgdal1h libgdal-dev; fi
-  - if test "$GDAL_VERSION" = "20"; then wget http://download.osgeo.org/gdal/2.0.3/gdal-2.0.3.tar.xz; tar xJf gdal-2.0.3.tar.xz; cd gdal-2.0.3; ./configure --prefix=/usr --enable-debug --without-libtool; make -j4 >/dev/null; sudo make install >/dev/null; cd ..; gdalinfo --version; fi
-  - if test "$GDAL_VERSION" = "21"; then wget http://download.osgeo.org/gdal/2.1.4/gdal-2.1.4.tar.xz; tar xJf gdal-2.1.4.tar.xz; cd gdal-2.1.4; ./configure --prefix=/usr --enable-debug --without-libtool; make -j4 >/dev/null; sudo make install >/dev/null; cd ..; gdalinfo --version; fi
-  - if test "$GDAL_VERSION" = "22"; then wget http://download.osgeo.org/gdal/2.2.2/gdal-2.2.2.tar.xz; tar xJf gdal-2.2.2.tar.xz; cd gdal-2.2.2; ./configure --prefix=/usr --enable-debug --without-libtool; make -j4 >/dev/null; sudo make install >/dev/null; cd ..; gdalinfo --version; fi
-
+  - sudo rm -rf /var/lib/postgresql
+  - apt-key adv --fetch-keys https://www.postgresql.org/media/keys/ACCC4CF8.asc
+  - sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main $PG_VERSION"    
+  - sudo apt-get update -qq
+  - sudo apt-get -y install postgresql-$PG_VERSION postgresql-server-dev-$PG_VERSION
+  - sudo cp ci/pg_hba.conf /etc/postgresql/$PG_VERSION/main/pg_hba.conf
+  - sudo /etc/init.d/postgresql reload
+  
+  - if [[ $GDAL_VERSION == 1* ]]; then sudo apt-get install libgdal1h libgdal-dev; fi
+  - if [[ $GDAL_VERSION == 2* ]]; then wget http://download.osgeo.org/gdal/$GDAL_VERSION/gdal-$GDAL_VERSION.tar.xz; tar xJf gdal-$GDAL_VERSION.tar.xz; cd gdal-$GDAL_VERSION; ./configure --prefix=/usr --enable-debug --without-libtool; make -j4 >/dev/null; sudo make install >/dev/null; cd ..; gdalinfo --version; fi
+  
 script:
   - make
   - sudo make install
   - sudo chmod 755 $HOME
-  - env
   - PGUSER=postgres make installcheck || (cat regression.diffs && /bin/false)
-# Small delay so that things get flushed
-#  - sleep 5
-# Check that ogr_fdw doesn't appear in Valgrind log
-#  - if sudo -u postgres grep ogr_fdw /tmp/postgres.log > /dev/null; then sudo -u postgres cat /tmp/postgres.log && /bin/false; fi
+


=====================================
Makefile
=====================================
--- a/Makefile
+++ b/Makefile
@@ -42,9 +42,6 @@ LIBS = $(GDAL_LIBS)
 ogr_fdw_info$(X): ogr_fdw_info.o ogr_fdw_common.o stringbuffer.o
 	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
 
-stringbuffer_pg.o: stringbuffer.c stringbuffer.h
-	$(CC) $(CFLAGS) -D USE_PG_MEM -c -o $@ $<
-
 clean-exe:
 	rm -f ogr_fdw_info$(X) ogr_fdw_info.o stringbuffer.o
 


=====================================
ci/pg_hba.conf
=====================================
--- /dev/null
+++ b/ci/pg_hba.conf
@@ -0,0 +1,8 @@
+# TYPE  DATABASE        USER            ADDRESS                 METHOD
+
+# "local" is for Unix domain socket connections only
+local   all             postgres                                trust
+# IPv4 local connections:
+host    all             postgres        127.0.0.1/32            trust
+# IPv6 local connections:
+host    all             postgres        ::1/128                 trust


=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,16 @@
-pgsql-ogr-fdw (1.0.5-3) UNRELEASED; urgency=medium
+pgsql-ogr-fdw (1.0.6-1) unstable; urgency=medium
 
+  * Team upload.
+  * New upstream release.
   * Update Vcs-* URLs for Salsa.
   * Bump Standards-Version to 4.1.5, no changes.
-  * Strip trailing whitespace from control file.
+  * Update copyright file, add license & copyright for stringbuffer_pg.c.
+  * Refresh patches.
+  * Fix typo in patch description.
+  * Enable all hardening buildflags.
+  * Add patch to use LDFLAGS for hardeningflags.
 
- -- Christoph Berg <myon at debian.org>  Sat, 31 Mar 2018 12:44:15 +0200
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 06 Jul 2018 19:47:19 +0200
 
 pgsql-ogr-fdw (1.0.5-2) unstable; urgency=medium
 


=====================================
debian/control
=====================================
--- a/debian/control
+++ b/debian/control
@@ -39,3 +39,4 @@ Description: PostgreSQL foreign data wrapper for OGR
     only requesting the columns needed to fulfill a query. This would be a
     minimal efficiency improvement, but can be removed given some development
     time, since the OGR API supports returning a subset of columns.
+


=====================================
debian/copyright
=====================================
--- a/debian/copyright
+++ b/debian/copyright
@@ -9,7 +9,9 @@ License: Expat
 
 Files: stringbuffer.c
        stringbuffer.h
-Copyright: 2002 Thamer Alharbash
+       stringbuffer_pg.c
+Copyright: 2002, Thamer Alharbash
+           2009, Paul Ramsey <pramsey at cleverelephant.ca>
 License: Expat
 
 Files: debian/*


=====================================
debian/patches/hardingflags.patch
=====================================
--- /dev/null
+++ b/debian/patches/hardingflags.patch
@@ -0,0 +1,14 @@
+Description: Use LDFLAGS for hardeningflags.
+Author: Bas Couwenberg <sebastic at debian.org>
+
+--- a/Makefile
++++ b/Makefile
+@@ -40,7 +40,7 @@ CFLAGS = $(GDAL_CFLAGS)
+ LIBS = $(GDAL_LIBS)
+ 
+ ogr_fdw_info$(X): ogr_fdw_info.o ogr_fdw_common.o stringbuffer.o
+-	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
++	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+ 
+ clean-exe:
+ 	rm -f ogr_fdw_info$(X) ogr_fdw_info.o stringbuffer.o


=====================================
debian/patches/install.patch
=====================================
--- a/debian/patches/install.patch
+++ b/debian/patches/install.patch
@@ -1,15 +1,13 @@
 Description: Fix installation of ogr_fdw_info binary.
- It would get installed with the name of the binary direcory itself instead of
+ It would get installed with the name of the binary directory itself instead of
  bin/ogr_fdw_info.
 Last-Update: 2017-02-19
 Author: Michael Fladischer <fladi at debian.org>
 Forwarded: no
 
-Index: postgresql-ogr-fdw/Makefile
-===================================================================
---- postgresql-ogr-fdw.orig/Makefile	2017-02-12 21:30:23.052413721 +0100
-+++ postgresql-ogr-fdw/Makefile	2017-02-19 19:16:44.736277938 +0100
-@@ -44,7 +44,7 @@
+--- a/Makefile
++++ b/Makefile
+@@ -46,7 +46,7 @@ clean-exe:
  	rm -f ogr_fdw_info$(X) ogr_fdw_info.o stringbuffer.o
  
  install-exe: all


=====================================
debian/patches/series
=====================================
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 install.patch
+hardingflags.patch


=====================================
debian/rules
=====================================
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,8 @@
 #!/usr/bin/make -f
 
+# Enable hardening build flags
+export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+
 # Rebuild debian/control from debian/control.in
 include /usr/share/postgresql-common/pgxs_debian_control.mk
 


=====================================
ogr_fdw.c
=====================================
--- a/ogr_fdw.c
+++ b/ogr_fdw.c
@@ -164,7 +164,7 @@ static void ogrReadColumnData(OgrFdwState *state);
 /* Global to hold GEOMETRYOID */
 Oid GEOMETRYOID = InvalidOid;
 
-#if GDAL_VERSION_MAJOR >= 2 && GDAL_VERSION_MINOR >= 1
+#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,1,0)
 static void
 ogrErrorHandler(CPLErr eErrClass, int err_no, const char *msg)
 {
@@ -204,7 +204,7 @@ _PG_init(void)
 
 	on_proc_exit(&ogr_fdw_exit, PointerGetDatum(NULL));
 
-#if GDAL_VERSION_MAJOR >= 2 && GDAL_VERSION_MINOR >= 1
+#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,1,0)
 	/* Hook up the GDAL error handlers to PgSQL elog() */
 	CPLSetErrorHandler(ogrErrorHandler);
 	CPLSetCurrentErrorHandlerCatchDebug(true);
@@ -1099,7 +1099,7 @@ ogrReadColumnData(OgrFdwState *state)
 	/* Get OGR metadata ready */
 	dfn = OGR_L_GetLayerDefn(state->ogr.lyr);
 	ogr_ncols = OGR_FD_GetFieldCount(dfn);
-#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(1,11,0)
+#if (GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(1,11,0))
 	ogr_geom_count = OGR_FD_GetGeomFieldCount(dfn);
 #else
 	ogr_geom_count = ( OGR_FD_GetGeomType(dfn) != wkbNone ) ? 1 : 0;
@@ -1155,7 +1155,11 @@ ogrReadColumnData(OgrFdwState *state)
 		getTypeBinaryOutputInfo(col.pgtype, &col.pgsendfunc, &col.pgsendvarlena);
 
 		/* Get the PgSQL column name */
-		col.pgname = get_relid_attribute_name(rel->rd_id, att_tuple->attnum);
+#if PG_VERSION_NUM >= 110000
+		col.pgname = get_attname(rel->rd_id, att_tuple->attnum, false);
+#else
+		col.pgname = get_attname(rel->rd_id, att_tuple->attnum);
+#endif
 
 		/* Handle FID first */
 		if ( strcaseeq(col.pgname, "fid") && (col.pgtype == INT4OID || col.pgtype == INT8OID) )
@@ -1442,7 +1446,7 @@ ogrFeatureToSlot(const OGRFeatureH feat, TupleTableSlot *slot, const OgrFdwExecS
 			unsigned char *wkb;
 			OGRErr err;
 
-#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(1,11,0)
+#if (GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(1,11,0))
 			OGRGeometryH geom = OGR_F_GetGeomFieldRef(feat, ogrfldnum);
 #else
 			OGRGeometryH geom = OGR_F_GetGeometryRef(feat);
@@ -1546,7 +1550,7 @@ ogrFeatureToSlot(const OGRFeatureH feat, TupleTableSlot *slot, const OgrFdwExecS
 		}
 		else if ( ogrvariant == OGR_FIELD )
 		{
-#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,2,0)
+#if (GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,2,0))
 			int field_not_null = OGR_F_IsFieldSet(feat, ogrfldnum) && ! OGR_F_IsFieldNull(feat, ogrfldnum);
 #else
 			int field_not_null = OGR_F_IsFieldSet(feat, ogrfldnum);
@@ -1797,7 +1801,7 @@ ogrSlotToFeature(const TupleTableSlot *slot, OGRFeatureH feat, const OgrFdwTable
 			OGRErr err;
 			if ( nulls[i] )
 			{
-#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(1,11,0)
+#if (GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(1,11,0))
 				err = OGR_F_SetGeomFieldDirectly(feat, ogrfldnum, NULL);
 #else
 				err = OGR_F_SetGeometryDirectly(feat, NULL);
@@ -1818,7 +1822,7 @@ ogrSlotToFeature(const TupleTableSlot *slot, OGRFeatureH feat, const OgrFdwTable
 				if ( err != OGRERR_NONE )
 					return err;
 
-#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(1,11,0)
+#if (GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(1,11,0))
 				err = OGR_F_SetGeomFieldDirectly(feat, ogrfldnum, geom);
 #else
 				err = OGR_F_SetGeometryDirectly(feat, geom);


=====================================
stringbuffer.c
=====================================
--- a/stringbuffer.c
+++ b/stringbuffer.c
@@ -11,18 +11,6 @@
 
 #include "stringbuffer.h"
 
-#ifdef USE_PG_MEM
-
-void * palloc(size_t sz);
-void pfree(void *ptr);
-void * repalloc(void *ptr, size_t sz);
-
-#define malloc(sz) palloc(sz)
-#define free(ptr) pfree(ptr)
-#define realloc(ptr,sz) repalloc(ptr,sz)
-
-#endif
-
 /**
 * Allocate a new stringbuffer_t. Use stringbuffer_destroy to free.
 */


=====================================
stringbuffer_pg.c
=====================================
--- /dev/null
+++ b/stringbuffer_pg.c
@@ -0,0 +1,32 @@
+/*-------------------------------------------------------------------------
+ *
+ * stringbuffer.c
+ *		  simple stringbuffer
+ *
+ * Copyright (c) 2009, Paul Ramsey <pramsey at cleverelephant.ca>
+ * Copyright (c) 2002 Thamer Alharbash
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/*
+ * We need a version of stringbuffer that uses palloc/pfree/repalloc
+ * for use inside PgSQL. (We are sharing code in ogr_fdw_common.c 
+ * between the commandline utility and the backend module, so we 
+ * cannot just depend on the PgSQL standard string handling utility)
+ * We rebuild it here, but with the pgsql memory stuff in place
+ * of the standard system calls
+ */
+
+#include "stringbuffer.h"
+
+void * palloc(size_t sz);
+void pfree(void *ptr);
+void * repalloc(void *ptr, size_t sz);
+
+#define malloc(sz) palloc(sz)
+#define free(ptr) pfree(ptr)
+#define realloc(ptr,sz) repalloc(ptr,sz)
+
+#include "stringbuffer.c"
+



View it on GitLab: https://salsa.debian.org/debian-gis-team/pgsql-ogr-fdw/compare/99c2f3ee6d1e2c336720ebfbde67d38385dc6d2c...38c97d19b8ecf5697bf14e5ebede3dc5c93c9c3b

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pgsql-ogr-fdw/compare/99c2f3ee6d1e2c336720ebfbde67d38385dc6d2c...38c97d19b8ecf5697bf14e5ebede3dc5c93c9c3b
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20180706/03a39298/attachment-0001.html>


More information about the Pkg-grass-devel mailing list