changeset 5169:db1a000a21a9

Make OPTIONAL_LIBS overwritable and fix geo importer call
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 04 Mar 2013 17:08:14 +0100 (2013-03-04)
parents 650f94ec3122
children c1b60f8c3390
files flys-backend/contrib/import_river.sh
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/contrib/import_river.sh	Mon Mar 04 12:55:49 2013 +0100
+++ b/flys-backend/contrib/import_river.sh	Mon Mar 04 17:08:14 2013 +0100
@@ -38,7 +38,10 @@
 
 MIN_MEMORY="8024m"
 
-OPTIONAL_LIBS="${DIR}"/../opt
+if [ -z "$OPTIONAL_LIBS" ]; then
+    OPTIONAL_LIBS="${DIR}"/../opt
+fi
+
 if [ -d "$OPTIONAL_LIBS" ]; then
     export PATH="$OPTIONAL_LIBS/bin:$PATH"
     export LD_LIBRARY_PATH="$OPTIONAL_LIBS/lib:$LD_LIBRARY_PATH"
@@ -319,14 +322,19 @@
     echo Importing Geographic data.
     echo Logging into: $LOG_FILE
 
-    python $DIR/geodaesie/shpimporter.py \
+    RIVER_PATH=$(grep "WSTDatei:" "$GEW_FILE" | awk '{print $2}')
+    RIVER_PATH=$(dirname "$RIVER_PATH")/../..
+    RIVER_PATH=$(readlink -f "$RIVER_PATH")
+
+    exec python $(dirname $0)/geodaesie/shpimporter.py \
     --directory $RIVER_PATH \
     --river_name $RIVER_NAME \
     --ogr_connection "$OGR_CONNECTION" \
     --host $HOST \
     --user $USER \
     --password $PASS \
-    --verbose 2 2>&1 > "$LOG_FILE"
+    --verbose 1 \
+    > "$LOG_FILE" 2>&1
 }
 
 

http://dive4elements.wald.intevation.org