Skip to content

Commit

Permalink
only install/copy srs.db that we're using (fix 56d03f7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 17, 2019
1 parent 93cd832 commit 557d1af
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 32 deletions.
1 change: 0 additions & 1 deletion debian/qgis-providers-common.postinst
Expand Up @@ -3,7 +3,6 @@ set -e

if [ "$1" = "configure" ] && [ -x /usr/lib/qgis/crssync ]; then
cp /usr/share/qgis/resources/srs-template.db /usr/share/qgis/resources/srs.db
cp /usr/share/qgis/resources/srs6-template.db /usr/share/qgis/resources/srs6.db
dpkg-trigger qgis-crssync
fi

Expand Down
3 changes: 0 additions & 3 deletions debian/qgis-providers-common.prerm
Expand Up @@ -4,8 +4,5 @@ set -e
if [ "$1" = "remove" ] && [ -e /usr/share/qgis/resources/srs.db ]; then
rm -f /usr/share/qgis/resources/srs.db || true
fi
if [ "$1" = "remove" ] && [ -e /usr/share/qgis/resources/srs6.db ]; then
rm -f /usr/share/qgis/resources/srs6.db || true
fi

#DEBHELPER#
3 changes: 0 additions & 3 deletions debian/qgis-providers.postinst
Expand Up @@ -5,9 +5,6 @@ if [ "$1" = "triggered" ] || [ "$1" = "configure" ]; then
if [ -w /usr/share/qgis/resources/srs.db ] && [ -x /usr/lib/qgis/crssync ]; then
/usr/lib/qgis/crssync
fi
if [ -w /usr/share/qgis/resources/srs6.db ] && [ -x /usr/lib/qgis/crssync ]; then
/usr/lib/qgis/crssync
fi
fi

#DEBHELPER#
1 change: 0 additions & 1 deletion debian/rules
Expand Up @@ -300,7 +300,6 @@ override_dh_auto_install:

# Don't ship srs.db, automatically updated in postinst with crssync
mv $(CURDIR)/debian/tmp/usr/share/qgis/resources/srs.db $(CURDIR)/debian/tmp/usr/share/qgis/resources/srs-template.db
mv $(CURDIR)/debian/tmp/usr/share/qgis/resources/srs6.db $(CURDIR)/debian/tmp/usr/share/qgis/resources/srs6-template.db

# Mime info
install -o root -g root -d $(CURDIR)/debian/tmp/usr/share/mime/packages
Expand Down
1 change: 0 additions & 1 deletion ms-windows/osgeo4w/package.cmd
Expand Up @@ -322,7 +322,6 @@ for %%i in (%packages%) do (
"apps/%PACKAGENAME%/resources/qgis.db" ^
"apps/%PACKAGENAME%/resources/spatialite.db" ^
"apps/%PACKAGENAME%/resources/srs.db" ^
"apps/%PACKAGENAME%/resources/srs.db" ^
"apps/%PACKAGENAME%/resources/symbology-style.xml" ^
"apps/%PACKAGENAME%/resources/cpt-city-qgis-min/" ^
"apps/%PACKAGENAME%/svg/" ^
Expand Down
13 changes: 11 additions & 2 deletions resources/CMakeLists.txt
@@ -1,5 +1,14 @@
INSTALL(FILES srs.db
srs6.db
IF (PROJ_VERSION_MAJOR GREATER 5)
MESSAGE(STATUS "Using PROJ 6 srs database.")
SET(SRSDB srs6.db)
ELSE (PROJ_VERSION_MAJOR GREATER 5)
MESSAGE(STATUS "Using PROJ <6 srs database.")
SET(SRSDB srs.db)
ENDIF (PROJ_VERSION_MAJOR GREATER 5)

INSTALL(FILES ${SRSDB} DESTINATION ${QGIS_DATA_DIR}/resources RENAME srs.db)

INSTALL(FILES
qgis.db
symbology-style.xml
spatialite.db
Expand Down
24 changes: 3 additions & 21 deletions src/core/qgsapplication.cpp
Expand Up @@ -955,34 +955,17 @@ QString QgsApplication::iconsPath()

QString QgsApplication::srsDatabaseFilePath()
{
#if PROJ_VERSION_MAJOR>=6
if ( ABISYM( mRunningFromBuildDir ) )
{
QString tempCopy = QDir::tempPath() + "/srs6.db";
QString tempCopy = QDir::tempPath() + "/srs.db";

if ( !QFile( tempCopy ).exists() )
{
#if PROJ_VERSION_MAJOR>=6
QFile f( pkgDataPath() + "/resources/srs6.db" );
if ( !f.copy( tempCopy ) )
{
qFatal( "Could not create temporary copy" );
}
}

return tempCopy;
}
else
{
return pkgDataPath() + QStringLiteral( "/resources/srs6.db" );
}
#else
if ( ABISYM( mRunningFromBuildDir ) )
{
QString tempCopy = QDir::tempPath() + "/srs.db";

if ( !QFile( tempCopy ).exists() )
{
QFile f( pkgDataPath() + "/resources/srs.db" );
#endif
if ( !f.copy( tempCopy ) )
{
qFatal( "Could not create temporary copy" );
Expand All @@ -995,7 +978,6 @@ QString QgsApplication::srsDatabaseFilePath()
{
return pkgDataPath() + QStringLiteral( "/resources/srs.db" );
}
#endif
}

QStringList QgsApplication::svgPaths()
Expand Down

0 comments on commit 557d1af

Please sign in to comment.