[GRASS-SVN] r42718 - grass/branches/develbranch_6/scripts/r.mask
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 8 06:35:07 EDT 2010
Author: neteler
Date: 2010-07-08 10:35:07 +0000 (Thu, 08 Jul 2010)
New Revision: 42718
Modified:
grass/branches/develbranch_6/scripts/r.mask/r.mask
Log:
shut up when --q
Modified: grass/branches/develbranch_6/scripts/r.mask/r.mask
===================================================================
--- grass/branches/develbranch_6/scripts/r.mask/r.mask 2010-07-08 10:34:55 UTC (rev 42717)
+++ grass/branches/develbranch_6/scripts/r.mask/r.mask 2010-07-08 10:35:07 UTC (rev 42718)
@@ -57,6 +57,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_$$"
@@ -90,13 +96,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
@@ -116,13 +122,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