[osm-tile-server] 10/117: Ask before importing

Ruben Undheim rubund-guest at moszumanska.debian.org
Tue Nov 3 23:18:14 UTC 2015


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

rubund-guest pushed a commit to branch master
in repository osm-tile-server.

commit 437cdacc4ca9e84610bd2f7edbeb45962e6c4cc5
Author: Ruben Undheim <ruben.undheim at gmail.com>
Date:   Thu Sep 3 00:19:47 2015 +0200

    Ask before importing
---
 debian/control                          | 7 ++++---
 debian/osm-tile-server-base.postinst    | 6 ------
 debian/osm-tile-server-config.config    | 1 +
 debian/osm-tile-server-config.postinst  | 5 +++++
 debian/osm-tile-server-config.templates | 7 +++++++
 5 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/debian/control b/debian/control
index 665f43d..526b133 100644
--- a/debian/control
+++ b/debian/control
@@ -14,17 +14,18 @@ Description: Meta package for installing OSM tile server
 Package: osm-tile-server-base
 Architecture: all
 Depends: ${misc:Depends},
-        osm-tile-server-config, openstreetmap-carto, node-carto, osm2pgsql
+        openstreetmap-carto, node-carto, osm2pgsql,
+        postgis, postgresql-contrib
 Description: Common files for OSM tile server
 
 Package: osm-tile-server-config
 Architecture: all
 Depends: ${misc:Depends},
-        postgis, postgresql-contrib
+        osm-tile-server-base
 Description: This package contains the main configuration of the OSM tile server
 
 Package: osm-tile-server-tilelite
 Architecture: all
 Depends: ${misc:Depends},
-         osm-tile-server-base, tilelite
+         osm-tile-server-config, tilelite
 Description: This sets up a full OSM tile server using tilelite
diff --git a/debian/osm-tile-server-base.postinst b/debian/osm-tile-server-base.postinst
index ecea881..f1d459b 100644
--- a/debian/osm-tile-server-base.postinst
+++ b/debian/osm-tile-server-base.postinst
@@ -22,12 +22,6 @@ set -e
 
 case "$1" in
     configure)
-        db_get osm-tile-server/db-user
-        DBUSER=$RET
-        db_get osm-tile-server/db-name
-        DBNAME=$RET
-
-        su $DBUSER -c "osm2pgsql --slim -d $DBNAME -C 1600 --hstore -S /usr/share/osm2pgsql/default.style /usr/share/osm-tile-server-base/samples/liechtenstein-latest.osm.pbf"
         
     ;;
 
diff --git a/debian/osm-tile-server-config.config b/debian/osm-tile-server-config.config
index 2ed1fc1..c059a67 100644
--- a/debian/osm-tile-server-config.config
+++ b/debian/osm-tile-server-config.config
@@ -6,6 +6,7 @@ set -e
 
 db_input high osm-tile-server/db-user || true
 db_input high osm-tile-server/db-name || true
+db_input high osm-tile-server/import-sample || true
 db_go
 
 exit 0
diff --git a/debian/osm-tile-server-config.postinst b/debian/osm-tile-server-config.postinst
index 42e4053..72ecea5 100644
--- a/debian/osm-tile-server-config.postinst
+++ b/debian/osm-tile-server-config.postinst
@@ -26,6 +26,8 @@ case "$1" in
         DBUSER=$RET
         db_get osm-tile-server/db-name
         DBNAME=$RET
+        db_get osm-tile-server/import-sample
+        IMPORTSAMPLE=$RET
 
         if ! getent group $DBUSER >/dev/null; then
             addgroup --system $DBUSER >/dev/null
@@ -59,6 +61,9 @@ case "$1" in
             echo "DONE"
         fi
    
+        if [ "$IMPORTSAMPLE" = "true" ] ; then
+            su $DBUSER -c "osm2pgsql --slim -d $DBNAME -C 1600 --hstore -S /usr/share/osm2pgsql/default.style /usr/share/osm-tile-server-base/samples/liechtenstein-latest.osm.pbf"
+        fi
         
     ;;
 
diff --git a/debian/osm-tile-server-config.templates b/debian/osm-tile-server-config.templates
index 518e4df..78c3995 100644
--- a/debian/osm-tile-server-config.templates
+++ b/debian/osm-tile-server-config.templates
@@ -9,3 +9,10 @@ Type: string
 Default: osm
 _Description: Enter name of the postgresql user:
 
+Template: osm-tile-server/import-sample
+Type: boolean
+Default: False
+_Description: Should a test OSM file be imported into the database?
+ If YES, a map of Liechtenstein will be imported so that it will be
+ available to test.
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osm-tile-server.git



More information about the Pkg-grass-devel mailing list