[GRASS-SVN] r38660 - grass/branches/develbranch_6/scripts/r.mask
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Aug 9 18:00:03 EDT 2009
Author: neteler
Date: 2009-08-09 18:00:03 -0400 (Sun, 09 Aug 2009)
New Revision: 38660
Modified:
grass/branches/develbranch_6/scripts/r.mask/r.mask
Log:
if map is given check if existing
Modified: grass/branches/develbranch_6/scripts/r.mask/r.mask
===================================================================
--- grass/branches/develbranch_6/scripts/r.mask/r.mask 2009-08-09 21:59:42 UTC (rev 38659)
+++ grass/branches/develbranch_6/scripts/r.mask/r.mask 2009-08-09 22:00:03 UTC (rev 38660)
@@ -74,6 +74,17 @@
# shell check for user break (signal list: trap -l)
trap "exitprocedure" 2 3 15
+# if map is given check if existing
+if [ $GIS_OPT_INPUT ]; then
+ eval `g.findfile element=cell file=$GIS_OPT_INPUT`
+ filename="${fullname}"
+ if [ "$filename" = "" ] ; then
+ g.message -e "Raster map <$GIS_OPT_INPUT> not found"
+ exit 1
+ fi
+fi
+
+
if [ "$GIS_FLAG_R" -eq 1 ]; then
if test -f `g.gisenv GISDBASE`/`g.gisenv LOCATION_NAME`/`g.gisenv MAPSET`/cell/MASK ; then
g.remove rast=MASK
@@ -112,4 +123,4 @@
g.message "restore raster operations to normal"
fi
-exit 0;
+exit 0
More information about the grass-commit
mailing list