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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 8 06:34:55 EDT 2010


Author: neteler
Date: 2010-07-08 10:34:55 +0000 (Thu, 08 Jul 2010)
New Revision: 42717

Modified:
   grass/branches/releasebranch_6_4/scripts/r.mask/r.mask
Log:
shut up when --q

Modified: grass/branches/releasebranch_6_4/scripts/r.mask/r.mask
===================================================================
--- grass/branches/releasebranch_6_4/scripts/r.mask/r.mask	2010-07-08 10:18:29 UTC (rev 42716)
+++ grass/branches/releasebranch_6_4/scripts/r.mask/r.mask	2010-07-08 10:34:55 UTC (rev 42717)
@@ -55,6 +55,12 @@
   exec g.parser "$0" "$@"
 fi
 
+if [ -z "$GRASS_VERBOSE" ] || [ "$GRASS_VERBOSE" -le 2 ] ; then
+  BEQUIET="--q"
+else
+  BEQUIET=""
+fi
+
 # temp file
 TEMPRAST="r_mask_$$"
 
@@ -88,13 +94,13 @@
 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
- 		g.message "Raster MASK removed"
+ 		g.message ${BEQUIET} "Raster MASK removed"
  	else
- 		g.message -w "No existing MASK to remove"
+ 		g.message ${BEQUIET} -w "No existing MASK to remove"
 	fi
 else
 	if [ ! $GIS_OPT_INPUT ]; then
-		g.message -w "No raster map for MASK provided"
+		g.message ${BEQUIET} -w "No raster map for MASK provided"
 		exit 1;
 	fi
 	if [ "$GIS_FLAG_O" -eq 1 ]; then
@@ -114,13 +120,13 @@
 		g.rename --q rast=MASK,$TEMPRAST
 		r.mapcalc "MASK=if(isnull($TEMPRAST),1,null())"
 		g.remove --q rast=$TEMPRAST
-		g.message "Inverted MASK created. All subsequent raster operations"
+		g.message ${BEQUIET} "Inverted MASK created. All subsequent raster operations"
 	else
-	  g.message "MASK created. All subsequent raster operations"
+	  g.message ${BEQUIET} "MASK created. All subsequent raster operations"
 	fi
-        g.message "will be limited to MASK area"
-        g.message "Removing or renaming raster file named MASK will"
-        g.message "restore raster operations to normal"
+        g.message ${BEQUIET} "will be limited to MASK area"
+        g.message ${BEQUIET} "Removing or renaming raster file named MASK will"
+        g.message ${BEQUIET} "restore raster operations to normal"
 fi
 
 exit 0



More information about the grass-commit mailing list