[Dive4elements-commits] [PATCH 2 of 9] Update run example scripts to work with the new packaging

Wald Commits scm-commit at wald.intevation.org
Wed Feb 20 18:31:15 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1361381342 -3600
# Branch dami
# Node ID 8208df10df7927ded3139dff72fea926fceddb63
# Parent  a56efdfcab17df93acae72ece077bddf2c463670
Update run example scripts to work with the new packaging

diff -r a56efdfcab17 -r 8208df10df79 flys-backend/contrib/run_geo.sh
--- a/flys-backend/contrib/run_geo.sh	Wed Feb 20 18:26:57 2013 +0100
+++ b/flys-backend/contrib/run_geo.sh	Wed Feb 20 18:29:02 2013 +0100
@@ -27,9 +27,19 @@
 SKIP_UESG=0
 SKIP_DGM=0
 
+# There should be no need to change anything below this line
+
 DIR=`dirname $0`
 DIR=`readlink -f "$DIR"`
 
+OPTIONAL_LIBS="${DIR}"/../opt
+if [ -d "$OPTIONAL_LIBS" ]; then
+    export PATH="$OPTIONAL_LIBS/bin:$PATH"
+    export LD_LIBRARY_PATH="$OPTIONAL_LIBS/lib:$LD_LIBRARY_PATH"
+    export LD_LIBRARY_PATH="$OPTIONAL_LIBS/lib64:$LD_LIBRARY_PATH"
+    export PYTHONPATH="$OPTIONAL_LIBS/lib/python2.6/site-packages:$PYTHONPATH"
+fi
+
 exec python $DIR/shpimporter/shpimporter.py \
     --directory $RIVER_PATH \
     --river_name $RIVER_NAME \
diff -r a56efdfcab17 -r 8208df10df79 flys-backend/contrib/run_hydr_morph.sh
--- a/flys-backend/contrib/run_hydr_morph.sh	Wed Feb 20 18:26:57 2013 +0100
+++ b/flys-backend/contrib/run_hydr_morph.sh	Wed Feb 20 18:29:02 2013 +0100
@@ -8,6 +8,7 @@
 BACKEND_PORT="1521"
 BACKEND_NAME="XE"
 LOG4J_CONFIG="conf/log4j.properties"
+JAR="hydr_morph/importer.jar"
 #####################################################################
 
 
@@ -54,25 +55,17 @@
 MIN_MEMORY="1024m"
 
 
-########################## Importer Settings ########################
-APP="de.intevation.flys.importer.Importer"
-DIR=`dirname $0`
-DIR=`readlink -f "$DIR/.."`
-#####################################################################
+######################### Run Importer ##############################
+OPTIONAL_LIBS="${DIR}"/../opt
+if [ -d "$OPTIONAL_LIBS" ]; then
+    export PATH="$OPTIONAL_LIBS/bin:$PATH"
+    export LD_LIBRARY_PATH="$OPTIONAL_LIBS/lib:$LD_LIBRARY_PATH"
+    export LD_LIBRARY_PATH="$OPTIONAL_LIBS/lib64:$LD_LIBRARY_PATH"
+fi
 
+export LC_ALL=de_DE at euro # Workaround encoding problem
 
-########################## Collect required libraries ###############
-CLASSPATH=
-for l in `find "$DIR/lib" -name \*.jar -print`; do
-   CLASSPATH=$CLASSPATH:$l
-done
-
-export CLASSPATH
-#####################################################################
-
-
-######################### Run Importer ##############################
-exec java \
+exec java -jar \
     -Xmx$MIN_MEMORY \
     -server \
     -Dlog4j.configuration=file://`readlink -f $LOG4J_CONFIG` \
@@ -108,4 +101,4 @@
     -Dflys.backend.url=$BACKEND_URL \
     -Dflys.backend.driver=$BACKEND_DB_DRIVER \
     -Dflys.backend.dialect=$BACKEND_DB_DIALECT \
-     $APP
+     $JAR


More information about the Dive4elements-commits mailing list