[PATCH 2 of 2] Add quotes in Path tests to avoid wrong results if variables are unset

Wald Commits scm-commit at wald.intevation.org
Fri Jun 19 18:00:54 CEST 2015


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1434728543 -7200
# Node ID 574f8b80799f2215c7de97c5515304bade070157
# Parent  340111f40f2de330e34db00a9b7c45066290eff1
Add quotes in Path tests to avoid wrong results if variables are unset

diff -r 340111f40f2d -r 574f8b80799f contrib/make_flys_release/make_release.sh
--- a/contrib/make_flys_release/make_release.sh	Fri Jun 19 17:41:35 2015 +0200
+++ b/contrib/make_flys_release/make_release.sh	Fri Jun 19 17:42:23 2015 +0200
@@ -160,7 +160,7 @@
 done
 
 
-if [ ! -f $FLYS_SOURCE_DIR/OpenLayers-2.11.tar.gz ]; then
+if [ ! -f "$FLYS_SOURCE_DIR/OpenLayers-2.11.tar.gz" ]; then
     echo "INFO: download OpenLayers-2.11 for client"
     cd $FLYS_SOURCE_DIR
     wget "https://github.com/openlayers/openlayers/releases/download/release-2.11/OpenLayers-2.11.tar.gz"
@@ -224,7 +224,7 @@
 sed -i -e "s at 1a4825f6-925f-11e3-8165-001f29e71d12@${ELBE_MODEL_UUID}@g" \
     $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html
 
-if [ -d $WEBINF ]; then
+if [ -d "$WEBINF" ]; then
     echo "INFO: copy custom client configuration to target destination"
     WEBINF_DIR=$FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/
     cp -R $WEBINF/* $WEBINF_DIR
@@ -233,23 +233,23 @@
     done
 fi
 
-if [ -f $CLIENT_CONF ]; then
+if [ -f "$CLIENT_CONF" ]; then
     echo "INFO: copy custom java script client configuration to target destination"
-    cp $CLIENT_CONF \
+    cp "$CLIENT_CONF" \
         $FLYS_SOURCE_DIR/river/gwt-client/src/main/java/org/dive4elements/river/client/client/config.xml
 fi
 
-if [ -n $DGM_PATH ]; then
+if [ -n "$DGM_PATH" ]; then
     sed -i -e "s@<dgm-path>.*</dgm-path>@<dgm-path>${DGM_PATH}</dgm-path>@g" \
         $FLYS_SOURCE_DIR/river/artifacts/doc/conf/conf.xml
 fi
 
-if [ -n $WIKI_URL ]; then
+if [ -n "$WIKI_URL" ]; then
     sed -i -e "s@<help-url>http://example.com</help-url>@<help-url>${WIKI_URL}</help-url>@g" \
         $FLYS_SOURCE_DIR/river/artifacts/doc/conf/conf.xml
 fi
 
-if [ -d $SERVER_CONF ]; then
+if [ -d "$SERVER_CONF" ]; then
     echo "INFO: copy custom server configuration to target destination"
     cp -R $SERVER_CONF/* $FLYS_SOURCE_DIR/river/artifacts/doc/conf/
     for file in `find $FLYS_SOURCE_DIR/river/artifacts/doc/conf -type f`; do
@@ -287,7 +287,7 @@
     flys-${VERSION}.war
 tar -rf flys-$VERSION.tar flys-${VERSION}.war
 
-if [ -f $INSTALL ]; then
+if [ -f "$INSTALL" ]; then
     echo "INFO: prepare custom installation script"
     cp $INSTALL .
     sed -i "s/D4E_VERSION/$VERSION/g" ./`basename $INSTALL`


More information about the Dive4Elements-commits mailing list