[osm-tile-server] 39/117: Added conf-file + some other things

Ruben Undheim rubund-guest at moszumanska.debian.org
Tue Nov 3 23:18:18 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 22112cf34c4676009f05111c89ef1462a20a2510
Author: Ruben Undheim <ruben.undheim at gmail.com>
Date:   Thu Sep 3 20:12:47 2015 +0200

    Added conf-file + some other things
---
 debian/osm-tile-server-base.install  | 1 +
 debian/osm-tile-server-base.postinst | 2 ++
 etc/osm-tile-server.conf             | 2 ++
 src/osm-tile-server-import.c         | 7 ++++++-
 4 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/debian/osm-tile-server-base.install b/debian/osm-tile-server-base.install
index b1693d1..186c185 100644
--- a/debian/osm-tile-server-base.install
+++ b/debian/osm-tile-server-base.install
@@ -1,2 +1,3 @@
 usr/bin/*
 samples usr/share/osm-tile-server-base/
+etc/osm-tile-server.conf /etc/
diff --git a/debian/osm-tile-server-base.postinst b/debian/osm-tile-server-base.postinst
index fa812cd..712a2a6 100644
--- a/debian/osm-tile-server-base.postinst
+++ b/debian/osm-tile-server-base.postinst
@@ -80,6 +80,8 @@ case "$1" in
             su $DBUSER -c "osm2pgsql --slim -d $DBNAME --cache-strategy sparse -C 100 --hstore -S /usr/share/osm2pgsql/default.style /usr/share/osm-tile-server-base/samples/liechtenstein-latest.osm.pbf"
         fi
 
+        sed -i 's/^DBNAME=""/DBNAME="'${DBNAME}'"/' /etc/osm-tile-server.conf
+
         chown $DBUSER:$DBUSER /usr/bin/osm-tile-server-import
         chmod 4554 /usr/bin/osm-tile-server-import
         
diff --git a/etc/osm-tile-server.conf b/etc/osm-tile-server.conf
new file mode 100644
index 0000000..5b552eb
--- /dev/null
+++ b/etc/osm-tile-server.conf
@@ -0,0 +1,2 @@
+
+DBNAME=""
diff --git a/src/osm-tile-server-import.c b/src/osm-tile-server-import.c
index 2064db2..8a51923 100644
--- a/src/osm-tile-server-import.c
+++ b/src/osm-tile-server-import.c
@@ -3,7 +3,12 @@
 
 int main(int argc, char **argv)
 {
-	system("whoami");
+	char command[256];
+
+	snprintf(command,255,"osm2pgsql --slim -d $DBNAME --cache-strategy sparse -C 100 --hstore -S /usr/share/osm2pgsql/default.style /usr/share/osm-tile-server-base/samples/liechtenstein-latest.osm.pbf");
+	printf("Importing to database with this command:\n");
+	printf(" %s\n",command);
+	//system(command);
 
 	return 0;
 

-- 
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