[spatialite-tools] 01/04: Add patch to use spatialite_init_ex() instead of spatialite_init(), the latter segfaults now that libspatialite is built with libproj 4.9.1.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Sat May 16 15:14:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to tag debian/4.1.1-5
in repository spatialite-tools.

commit f835b51689e11afe11f1a26c78def1c303237239
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri May 15 17:54:35 2015 +0200

    Add patch to use spatialite_init_ex() instead of spatialite_init(), the latter segfaults now that libspatialite is built with libproj 4.9.1.
---
 debian/changelog                        |  8 ++++
 debian/control                          |  2 +-
 debian/patches/11-spatialite_init.patch | 85 +++++++++++++++++++++++++++++++++
 debian/patches/series                   |  1 +
 4 files changed, 95 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 9067233..d3e2770 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+spatialite-tools (4.1.1-5) UNRELEASED; urgency=medium
+
+  * Add patch to use spatialite_init_ex() instead of spatialite_init(),
+    the latter segfaults now that libspatialite is built with libproj 4.9.1.
+    (closes: #785091)
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 15 May 2015 17:53:32 +0200
+
 spatialite-tools (4.1.1-4) unstable; urgency=medium
 
   * Add patch to not require an extact match between the sqlite3 header
diff --git a/debian/control b/debian/control
index 625dad4..89555ac 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: spatialite-tools
 Maintainer: Debian GIS Project <pkg-grass-devel at lists.alioth.debian.org>
 Uploaders: Francesco Paolo Lovergine <frankie at debian.org>,
            David Paleino <dapal at debian.org>,
-           Bas Couwenberg <sebastic at xs4all.nl>
+           Bas Couwenberg <sebastic at debian.org>
 Section: science
 Priority: optional
 Build-Depends: debhelper (>= 9),
diff --git a/debian/patches/11-spatialite_init.patch b/debian/patches/11-spatialite_init.patch
new file mode 100644
index 0000000..f65b228
--- /dev/null
+++ b/debian/patches/11-spatialite_init.patch
@@ -0,0 +1,85 @@
+Description: Use spatialite_init_ex for threadsafety.
+Author: Sandro Furieri <a.furieri at lqt.it>
+Origin: https://groups.google.com/d/msg/spatialite-users/v-RCCrx5GoM/qOJ678RIeVsJ
+Bug-Debian: https://bugs.debian.org/785091
+
+--- a/shell.c
++++ b/shell.c
+@@ -119,6 +119,10 @@ extern int isatty(int);
+ /* True if the timer is enabled */
+ static int enableTimer = 0;
+ 
++/* sandro 2013-11-07 */
++void *splite_cache = NULL;
++/* end sandro 2013-11-07 */
++
+ /* ctype macros that work with signed characters */
+ #define IsSpace(X)  isspace((unsigned char)X)
+ #define IsDigit(X)  isdigit((unsigned char)X)
+@@ -259,6 +263,13 @@ static int sql_log_enabled = 1;
+ static int bail_on_error = 0;
+ 
+ /*
++** sandro 2013-08-30
++** If the following flag is set, no welcome message will be
++** printed at all.
++*/
++static int splite_silent = 0;
++
++/*
+ ** Threat stdin as an interactive input if the following variable
+ ** is true.  Otherwise, assume stdin is connected to a file or pipe.
+ */
+@@ -2242,6 +2253,7 @@ static void open_db(struct callback_data
+           p->zDbFilename, sqlite3_errmsg(db));
+       exit(1);
+     }
++    spatialite_init_ex (p->db, splite_cache, (splite_silent == 0) ? 1 : 0);
+ #ifndef SQLITE_OMIT_LOAD_EXTENSION
+     sqlite3_enable_load_extension(p->db, 1);
+ #endif
+@@ -4100,6 +4112,9 @@ int main(int argc, char **argv){
+   char *zFirstCmd = 0;
+   int i;
+   int rc = 0;
++  
++/* initializing the SpatiaLite's internal cache */
++  splite_cache = spatialite_alloc_connection ();
+ 
+ /* Don't require exact sqlite3 version match
+   if( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)!=0 ){
+@@ -4114,8 +4129,13 @@ int main(int argc, char **argv){
+ Sandro Furieri 30 May 2008
+ ===========================
+ registering the SpatiaLite extension
++2013-08-30: supporting "silent mode"
+ */
+-    spatialite_init (1);
++  for(i=1; i<argc && argv[i][0]=='-'; i++){
++    char *z = argv[i];
++    if( z[1]=='-' ){ z++; }
++    if( strcmp(z,"-silent")==0 ){ splite_silent = 1;}
++	}
+ 
+   stdin_is_interactive = isatty(0);
+ 
+@@ -4287,6 +4307,10 @@ registering the SpatiaLite extension
+       data.statsOn = 1;
+     }else if( strcmp(z,"-bail")==0 ){
+       bail_on_error = 1;
++    }else if( strcmp(z,"-silent")==0 ){
++/* sandro 2013-08-30 */
++      splite_silent = 1;
++/* end sandro */
+     }else if( strcmp(z,"-version")==0 ){
+       printf("%s %s\n", sqlite3_libversion(), sqlite3_sourceid());
+       return 0;
+@@ -4416,7 +4440,7 @@ Sandro Furieri 30 May 2008
+ ===========================
+ memory cleanup for SpatiaLite extension
+ */
+-    sqlite3_reset_auto_extension ();
++  spatialite_cleanup_ex (splite_cache);
+ 
+   return rc;
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 38a1567..5bf4f1a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@
 08-indifferently-typo.patch
 09-default-typo.patch
 10-no-sqlite-check.patch
+11-spatialite_init.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/spatialite-tools.git



More information about the Pkg-grass-devel mailing list