[GRASS-SVN] r43157 - grass/branches/develbranch_6/scripts/g.extension

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 18 10:16:43 EDT 2010


Author: hamish
Date: 2010-08-18 14:16:43 +0000 (Wed, 18 Aug 2010)
New Revision: 43157

Modified:
   grass/branches/develbranch_6/scripts/g.extension/g.extension
Log:
quoting (curly brackets do not protect from spaces in pathnames); remove == bashism; whitespace

Modified: grass/branches/develbranch_6/scripts/g.extension/g.extension
===================================================================
--- grass/branches/develbranch_6/scripts/g.extension/g.extension	2010-08-18 06:14:47 UTC (rev 43156)
+++ grass/branches/develbranch_6/scripts/g.extension/g.extension	2010-08-18 14:16:43 UTC (rev 43157)
@@ -4,7 +4,7 @@
 #
 # MODULE:       g.extension
 # AUTHOR(S):   	Markus Neteler
-# PURPOSE:      Tool to download and install extensions from GRASS Addons SVN into 
+# PURPOSE:      Tool to download and install extensions from GRASS Addons SVN into
 #               local GRASS installation
 # COPYRIGHT:    (C) 2009-2010 by the Markus Neteler, GRASS Development Team
 #
@@ -71,7 +71,7 @@
 
 # definitions
 
-SVNURL_ADDONS=${GIS_OPT_SVNURL}
+SVNURL_ADDONS="$GIS_OPT_SVNURL"
 MODULE="$GIS_OPT_EXTENSION"
 PREFIX="$GIS_OPT_PREFIX"
 
@@ -113,29 +113,29 @@
 expand_module_class_name()
 {
 # $1: module class
- if [ "$1" = "d" ]  ; then 
-    echo "display"  
-  elif [ "$1" = "db" ] ; then 
-    echo "database" 
-  elif [ "$1" = "g" ]  ; then 
-    echo "general" 
-  elif [ "$1" = "i" ]  ; then 
-    echo "imagery" 
-  elif [ "$1" = "m" ]  ; then 
-    echo "misc" 
-  elif [ "$1" = "ps" ] ; then 
-    echo "postscript" 
-#  elif [ "$1" = "p" ]  ; then 
-#    echo "paint" 
-  elif [ "$1" = "r" ]  ; then 
-    echo "raster" 
-  elif [ "$1" = "r3" ]  ; then 
-    echo "raster3D" 
-#  elif [ "$1" = "s" ]  ; then 
-#    echo "sites" 
-  elif [ "$1" = "v" ]  ; then 
+ if [ "$1" = "d" ]  ; then
+    echo "display"
+  elif [ "$1" = "db" ] ; then
+    echo "database"
+  elif [ "$1" = "g" ]  ; then
+    echo "general"
+  elif [ "$1" = "i" ]  ; then
+    echo "imagery"
+  elif [ "$1" = "m" ]  ; then
+    echo "misc"
+  elif [ "$1" = "ps" ] ; then
+    echo "postscript"
+#  elif [ "$1" = "p" ]  ; then
+#    echo "paint"
+  elif [ "$1" = "r" ]  ; then
+    echo "raster"
+  elif [ "$1" = "r3" ]  ; then
+    echo "raster3D"
+#  elif [ "$1" = "s" ]  ; then
+#    echo "sites"
+  elif [ "$1" = "v" ]  ; then
     echo "vector"
-  else 
+  else
     echo "$1"
  fi
 }
@@ -175,8 +175,8 @@
 
 ##
 cleanup(){
- if  [ ! -z "${TMPDIR}" ] ; then
-     rm -rf "${TMPDIR}"
+ if  [ -n "$TMPDIR" ] ; then
+     rm -rf "$TMPDIR"
  fi
 }
 
@@ -191,8 +191,8 @@
    exit 1
 fi
 
-if [ "$PREFIX" == '$GISBASE' ] ; then                               
-   PREFIX=$GISBASE                                                  
+if [ "$PREFIX" = '$GISBASE' ] ; then
+   PREFIX="$GISBASE"
 fi
 
 if [ -d "$PREFIX" ] ; then
@@ -202,9 +202,9 @@
     exit 1
 fi
 
-if [ "$GIS_OPT_OPERATION" == "remove" ] ; then
+if [ "$GIS_OPT_OPERATION" = "remove" ] ; then
    g.message message="Removing <$MODULE>..."
-   
+
    if test -f "${MYINST_DIR}/bin/${MODULE}" ; then
        rm -f "${MYINST_DIR}/bin/${MODULE}"
    fi
@@ -222,7 +222,7 @@
 
 cd "$TMPDIR"
 g.message message="Fetching <$MODULE> from GRASS-Addons SVN (be patient)..."
-svn co ${SVNURL_ADDONS}/${MODULECLASS}/${MODULE}
+svn co "${SVNURL_ADDONS}/${MODULECLASS}/${MODULE}"
 
 if [ $? -ne 0 ] ; then
    g.message -e message="GRASS Addon ${MODULE} not found in repository or no network connection or another problem"
@@ -240,7 +240,7 @@
    g.message message="Installing ${MODULE}..."
 
    # is it a script?
-   grep "default: script" $TMPDIR/${MODULE}/Makefile 2>&1 >/dev/null
+   grep "default: script" "$TMPDIR/$MODULE/Makefile" 2>&1 >/dev/null
    if [ $? -eq 0 ] ; then
       PROGTYPE=scripts
    else
@@ -261,7 +261,7 @@
    fi
    touch "${MYINST_DIR}/`basename $0`.$$"
    if [ $? -ne 0 ] ; then
-      g.message -e message="Cannot write to <${MYINST_DIR}>, installation failed"
+      g.message -e message="Cannot write to <$MYINST_DIR>, installation failed"
       exit 1
    else
       rm -f "${MYINST_DIR}/`basename $0`.$$"
@@ -286,5 +286,5 @@
 
 g.message message=""
 g.message message="Installation of <$MODULE> in <$MYINST_DIR> successfully finished."
+
 exit 0
-



More information about the grass-commit mailing list