From bbf038cd7fa8567d7e592e24af61e32aabd80b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Fr=C3=B6hlich?= Date: Sun, 14 Feb 2016 02:00:34 +0100 Subject: [PATCH] New version 1.11.4 plus fix for GDAL #6360 --- .gitignore | 2 + gdal-1.11.4-sqlite-crash.patch | 79 ++++++++++++++++++++++++++++++++++ gdal-cleaner.sh | 2 +- gdal.spec | 13 +++++- sources | 4 +- 5 files changed, 95 insertions(+), 5 deletions(-) create mode 100644 gdal-1.11.4-sqlite-crash.patch diff --git a/.gitignore b/.gitignore index 811c953..a43a288 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ gdalautotest-1.7.0.tar.gz /gdal-1.11.2-fedora.tar.xz /gdalautotest-1.11.3.tar.gz /gdal-1.11.3-fedora.tar.xz +/gdalautotest-1.11.4.tar.gz +/gdal-1.11.4-fedora.tar.xz diff --git a/gdal-1.11.4-sqlite-crash.patch b/gdal-1.11.4-sqlite-crash.patch new file mode 100644 index 0000000..d225008 --- /dev/null +++ b/gdal-1.11.4-sqlite-crash.patch @@ -0,0 +1,79 @@ +Index: /branches/1.11/gdal/ogr/ogrsf_frmts/sqlite/ogrsqlitevfs.cpp +=================================================================== +--- /branches/1.11/gdal/ogr/ogrsf_frmts/sqlite/ogrsqlitevfs.cpp (revision 33411) ++++ /branches/1.11/gdal/ogr/ogrsf_frmts/sqlite/ogrsqlitevfs.cpp (revision 33412) +@@ -423,9 +423,49 @@ + } + +-static int OGRSQLiteVFSCurrentTime (sqlite3_vfs* pVFS, double* p1) +-{ +- sqlite3_vfs* pUnderlyingVFS = GET_UNDERLYING_VFS(pVFS); +- //CPLDebug("SQLITE", "OGRSQLiteVFSCurrentTime()"); +- return pUnderlyingVFS->xCurrentTime(pUnderlyingVFS, p1); ++// Derived for sqlite3.c implementation of unixCurrentTime64 and winCurrentTime64 ++#ifdef WIN32 ++#include ++static int OGRSQLiteVFSCurrentTimeInt64 (sqlite3_vfs* /*pVFS*/, sqlite3_int64 *piNow) ++{ ++ FILETIME ft; ++ static const sqlite3_int64 winFiletimeEpoch = 23058135*(sqlite3_int64)8640000; ++ static const sqlite3_int64 max32BitValue = ++ (sqlite3_int64)2000000000 + (sqlite3_int64)2000000000 + ++ (sqlite3_int64)294967296; ++ ++#if defined(_WIN32_WCE) ++ SYSTEMTIME time; ++ GetSystemTime(&time); ++ /* if SystemTimeToFileTime() fails, it returns zero. */ ++ if (!SystemTimeToFileTime(&time,&ft)){ ++ return SQLITE_ERROR; ++ } ++#else ++ GetSystemTimeAsFileTime( &ft ); ++#endif ++ *piNow = winFiletimeEpoch + ++ ((((sqlite3_int64)ft.dwHighDateTime)*max32BitValue) + ++ (sqlite3_int64)ft.dwLowDateTime)/(sqlite3_int64)10000; ++ return SQLITE_OK; ++} ++#else ++#include ++static int OGRSQLiteVFSCurrentTimeInt64 (sqlite3_vfs* /*pVFS*/, sqlite3_int64 *piNow) ++{ ++ struct timeval sNow; ++ static const sqlite3_int64 unixEpoch = 24405875*(sqlite3_int64)8640000; ++ (void)gettimeofday(&sNow, NULL); /* Cannot fail given valid arguments */ ++ *piNow = unixEpoch + 1000*(sqlite3_int64)sNow.tv_sec + sNow.tv_usec/1000; ++ ++ return SQLITE_OK; ++} ++#endif ++ ++static int OGRSQLiteVFSCurrentTime (sqlite3_vfs* /*pVFS*/, double* p1) ++{ ++ sqlite3_int64 i = 0; ++ int rc = OGRSQLiteVFSCurrentTimeInt64(NULL, &i); ++ *p1 = i/86400000.0; ++ return rc; + } + +@@ -450,5 +490,9 @@ + pVFSAppData->nCounter = 0; + ++#if SQLITE_VERSION_NUMBER >= 3008000L /* perhaps not the minimal version that defines xCurrentTimeInt64, but who cares */ ++ pMyVFS->iVersion = 2; ++#else + pMyVFS->iVersion = 1; ++#endif + pMyVFS->szOsFile = sizeof(OGRSQLiteFileStruct); + pMyVFS->mxPathname = pDefaultVFS->mxPathname; +@@ -467,4 +511,9 @@ + pMyVFS->xCurrentTime = OGRSQLiteVFSCurrentTime; + pMyVFS->xGetLastError = OGRSQLiteVFSGetLastError; ++#if SQLITE_VERSION_NUMBER >= 3008000L /* perhaps not the minimal version that defines xCurrentTimeInt64, but who cares */ ++ if( pMyVFS->iVersion >= 2 ) ++ pMyVFS->xCurrentTimeInt64 = OGRSQLiteVFSCurrentTimeInt64; ++#endif ++ + return pMyVFS; + } diff --git a/gdal-cleaner.sh b/gdal-cleaner.sh index 29abe4b..4f94bda 100755 --- a/gdal-cleaner.sh +++ b/gdal-cleaner.sh @@ -1,6 +1,6 @@ #!/bin/bash # Volker Fröhlich -VERSION="1.11.3" +VERSION="1.11.4" tar xvf gdal-"${VERSION}".tar.xz diff --git a/gdal.spec b/gdal.spec index 2b52aa0..63fc09c 100644 --- a/gdal.spec +++ b/gdal.spec @@ -22,7 +22,7 @@ # Tests can be of a different version -%global testversion 1.11.3 +%global testversion 1.11.4 %global run_tests 1 %global with_spatialite 1 @@ -39,7 +39,7 @@ Name: gdal -Version: 1.11.3 +Version: 1.11.4 Release: 1%{?dist} Summary: GIS file format library Group: System Environment/Libraries @@ -65,6 +65,9 @@ Patch2: %{name}-jni.patch # https://trac.osgeo.org/gdal/ticket/6159#ticket Patch3: %{name}-2.0.1-iso8211-include.patch +# https://trac.osgeo.org/gdal/ticket/6360 +Patch4: %{name}-1.11.4-sqlite-crash.patch + # Fedora uses Alternatives for Java Patch8: %{name}-1.9.0-java.patch @@ -269,6 +272,7 @@ rm -r frmts/grib/degrib18/g2clib-1.0.4 %patch1 -p1 -b .g2clib~ %patch2 -p1 -b .jni~ %patch3 -p1 -b .iso8211~ +%patch4 -p4 -b .sqlite~ %patch8 -p1 -b .java~ # Copy in PROVENANCE.TXT-fedora @@ -655,6 +659,7 @@ for f in 'GDAL*' BandProperty ColorAssociation CutlineTransformer DatasetPropert done #TODO: What's that? rm -f %{buildroot}%{_mandir}/man1/*_%{name}-%{version}-fedora_apps_* +rm -f %{buildroot}%{_mandir}/man1/_home_rouault_dist_wrk_gdal_apps_.1* %check %if %{run_tests} @@ -783,6 +788,10 @@ popd #Or as before, using ldconfig %changelog +* Wed Oct 21 2015 Volker Froehlich - 1.11.4-1 +- New release +- Patch for GDAL issue #6360 + * Wed Oct 21 2015 Volker Froehlich - 1.11.3-1 - New release diff --git a/sources b/sources index 69e5b8b..f1c6d1f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -2b6ba83e78a3ce5ffbed8f14ddd0029a gdalautotest-1.11.3.tar.gz -b07d7f7d1c0032fb8207df477644534a gdal-1.11.3-fedora.tar.xz +8b63eaff1df4d8ccd1a17b497b189282 gdalautotest-1.11.4.tar.gz +4003b0a4c6c3eb603cd63e61fb9416e2 gdal-1.11.4-fedora.tar.xz