[GRASS-SVN] r38659 - grass/branches/releasebranch_6_4/scripts/r.mask

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 9 17:59:44 EDT 2009


Author: neteler
Date: 2009-08-09 17:59:42 -0400 (Sun, 09 Aug 2009)
New Revision: 38659

Modified:
   grass/branches/releasebranch_6_4/scripts/r.mask/r.mask
Log:
if map is given check if existing

Modified: grass/branches/releasebranch_6_4/scripts/r.mask/r.mask
===================================================================
--- grass/branches/releasebranch_6_4/scripts/r.mask/r.mask	2009-08-09 16:11:10 UTC (rev 38658)
+++ grass/branches/releasebranch_6_4/scripts/r.mask/r.mask	2009-08-09 21:59:42 UTC (rev 38659)
@@ -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