[GRASS-SVN] r49698 - grass-addons/tools/addons

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 13 01:18:04 EST 2011


Author: hamish
Date: 2011-12-12 22:18:03 -0800 (Mon, 12 Dec 2011)
New Revision: 49698

Modified:
   grass-addons/tools/addons/compile.sh
Log:
always "quote" path names, especially if 'rm -rf' is involved.
curly {brackets} do nothing to protect path names from spaces etc.
+ build raster3d


Modified: grass-addons/tools/addons/compile.sh
===================================================================
--- grass-addons/tools/addons/compile.sh	2011-12-13 05:49:18 UTC (rev 49697)
+++ grass-addons/tools/addons/compile.sh	2011-12-13 06:18:03 UTC (rev 49698)
@@ -16,18 +16,18 @@
     SEP=0
 fi
 
-rm -rf $ADDON_PATH
-mkdir  $ADDON_PATH
+rm -rf "$ADDON_PATH"
+mkdir  "$ADDON_PATH"
 
-cd $SVN_PATH
+cd "$SVN_PATH"
 
-mkdir $ADDON_PATH/log
-touch $ADDON_PATH/log/ALL.log
+mkdir "$ADDON_PATH/log"
+touch "$ADDON_PATH/log/ALL.log"
 
 echo "-----------------------------------------------------"
 echo "AddOns '$ADDON_PATH'..."
 echo "-----------------------------------------------------"
-for c in "display" "general" "imagery" "raster" "vector"; do
+for c in "display" "general" "imagery" "raster" "raster3d" "vector"; do
     if [ ! -d $c ]; then
 	continue
     fi
@@ -35,25 +35,25 @@
     for m in `ls -d */ 2>/dev/null` ; do
 	m="${m%%/}"
 	echo -n "Compiling $m..."
-	cd $m
+	cd "$m"
 	if [ $SEP -eq 1 ] ; then
-	    path=${ADDON_PATH}/$m
+	    path="$ADDON_PATH/$m"
 	else
-	    path=$ADDON_PATH
+	    path="$ADDON_PATH"
 	fi
 	
-	make MODULE_TOPDIR=$TOPDIR clean > /dev/null 2>&1
-	make MODULE_TOPDIR=$TOPDIR \
-	    BIN=$path/bin \
-	    HTMLDIR=$path/docs/html \
-	    MANDIR=$path/man/man1 \
-	    SCRIPTDIR=$path/scripts \
-	    ETC=$path/etc >$ADDON_PATH/log/${m}.log 2>&1
+	make MODULE_TOPDIR="$TOPDIR" clean > /dev/null 2>&1
+	make MODULE_TOPDIR="$TOPDIR" \
+	    BIN="$path/bin" \
+	    HTMLDIR="$path/docs/html" \
+	    MANDIR="$path/man/man1" \
+	    SCRIPTDIR="$path/scripts" \
+	    ETC="$path/etc" > "$ADDON_PATH/log/$m.log" 2>&1
 	if [ `echo $?` -eq 0 ] ; then
-	    printf "%-30s%s\n" "$c/$m" "SUCCESS" >> $ADDON_PATH/log/ALL.log
+	    printf "%-30s%s\n" "$c/$m" "SUCCESS" >> "$ADDON_PATH/log/ALL.log"
 	    echo " SUCCESS"
 	else
-	    printf "%-30s%s\n" "$c/$m" "FAILED" >> $ADDON_PATH/log/ALL.log
+	    printf "%-30s%s\n" "$c/$m" "FAILED" >> "$ADDON_PATH/log/ALL.log"
 	    echo " FAILED"
 	fi
 	cd ..



More information about the grass-commit mailing list