[GRASS-SVN] r43827 -
grass/branches/develbranch_6/scripts/g.extension
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Oct 9 06:33:20 EDT 2010
Author: hamish
Date: 2010-10-09 10:33:20 +0000 (Sat, 09 Oct 2010)
New Revision: 43827
Modified:
grass/branches/develbranch_6/scripts/g.extension/g.extension
Log:
- wget needs output filename,
- don't list Makefiles,
- fix bashism string compare,
- note if GRASS_ADDON_PATH will be needed
Modified: grass/branches/develbranch_6/scripts/g.extension/g.extension
===================================================================
--- grass/branches/develbranch_6/scripts/g.extension/g.extension 2010-10-08 13:01:36 UTC (rev 43826)
+++ grass/branches/develbranch_6/scripts/g.extension/g.extension 2010-10-09 10:33:20 UTC (rev 43827)
@@ -43,7 +43,7 @@
#% key_desc: url
#% description: SVN Addons repository URL
#% required: yes
-#% answer: https://svn.osgeo.org/grass/grass-addons/
+#% answer: https://svn.osgeo.org/grass/grass-addons
#%end
#%option
#% key: prefix
@@ -172,7 +172,7 @@
cd "$TMPDIR"
rm -f index.html
if [ "$USE_WGET" ] ; then
- wget --quiet -nv "$SVNURL_ADDONS/$MODCLASS"
+ wget --quiet -nv "$SVNURL_ADDONS/$MODCLASS" -O index.html
else
curl -silent --location "$SVNURL_ADDONS/$MODCLASS" -o index.html
fi
@@ -180,7 +180,7 @@
cut -d'"' -f2 | sed 's+/$++g' >> list_$$.txt
rm -f index.html
done
- cat list_$$.txt
+ grep -v 'Makefile' list_$$.txt
rm -f list_$$.txt
# so why save to a file at all instead of cat'ing directly?
}
@@ -204,14 +204,15 @@
fi
-if [ "$PREFIX" == '$GRASS_ADDON_PATH' ] ; then
+if [ "$PREFIX" = '$GRASS_ADDON_PATH' ] ; then
if [ -z "$GRASS_ADDON_PATH" ] ; then
- g.message -w message="GRASS_ADDON_PATH is not defined, installing to ~/.grass6/addons/"
- #g.message message="Suggest you set GRASS_ADDON_PATH and GRASS_ADDON_ETC to ..."
- ## will GRASS_ADDON_ETC help for man/ and docs/ ?
+ g.message -w message="GRASS_ADDON_PATH is not defined, installing to ~/.grass6/addons/"
+ ADDON_PATH_EMPTY=true
+ #g.message message="Suggest you set GRASS_ADDON_PATH and GRASS_ADDON_ETC to ..."
+ ## will GRASS_ADDON_ETC help for man/ and docs/ ?
## maybe have g.manual search in GRASS_ADDON_ETC/../ ? :-/
- mkdir -p ~/.grass6/addons
- GRASS_ADDON_PATH=~/.grass6/addons
+ mkdir -p ~/.grass6/addons
+ GRASS_ADDON_PATH=~/.grass6/addons
fi
PREFIX="$GRASS_ADDON_PATH"
elif [ "$PREFIX" = '$GISBASE' ] || [ $GIS_FLAG_S -eq 1 ] ; then
@@ -327,9 +328,15 @@
fi
fi
+#TODO: implement the $GIS_FLAG_S flag using sudo.
+
cleanup
g.message message=""
g.message message="Installation of <$MODULE> in <$MYINST_DIR> successfully finished."
+if [ -n "$ADDON_PATH_EMPTY" ] && [ "$GIS_FLAG_S" -eq 0 ] ; then
+ g.message -w message='This add-on module will not function until you set the GRASS_ADDON_PATH environment variable (see "g.manual variables")'
+fi
+
exit 0
More information about the grass-commit
mailing list