[GRASS-SVN] r31829 - grass/branches/develbranch_6/scripts/i.fusion.brovey

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 23 13:00:59 EDT 2008


Author: hamish
Date: 2008-06-23 13:00:58 -0400 (Mon, 23 Jun 2008)
New Revision: 31829

Modified:
   grass/branches/develbranch_6/scripts/i.fusion.brovey/i.fusion.brovey
Log:
shell fns must be defined before being used
remove temp region after use (trac bug #194)
unset WIND_OVERRIDE before removing it
remove unused PROG variable


Modified: grass/branches/develbranch_6/scripts/i.fusion.brovey/i.fusion.brovey
===================================================================
--- grass/branches/develbranch_6/scripts/i.fusion.brovey/i.fusion.brovey	2008-06-23 15:55:11 UTC (rev 31828)
+++ grass/branches/develbranch_6/scripts/i.fusion.brovey/i.fusion.brovey	2008-06-23 17:00:58 UTC (rev 31829)
@@ -9,7 +9,7 @@
 #                 - SPOT MS and pan (high res)
 #                 - QuickBird MS and pan (high res)
 #
-# COPYRIGHT:	(C) 2002,2004 by the GRASS Development Team
+# COPYRIGHT:	(C) 2002-2008 by the GRASS Development Team
 #
 #		This program is free software under the GNU General Public
 #		License (>=v2). Read the file COPYING that comes with GRASS
@@ -78,19 +78,10 @@
 #% required : yes
 #%end
 
-# what to do in case of user break:
-exitprocedure()
-{
- g.message -e message='User break!'
- cleanup
- exit 1
-}
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
 
 if test "$GISBASE" = ""; then
- echo "You must be in GRASS GIS to run this program." >&2
- exit 1
+   echo "You must be in GRASS GIS to run this program." >&2
+   exit 1
 fi
 
 # save command line
@@ -103,8 +94,27 @@
     exec g.parser "$0" "$@"
 fi
 
-PROG=`basename $0`
 
+cleanup()
+{
+   #remove temporary region file
+   unset WIND_OVERRIDE
+   g.remove region="i.fusion.brovey.$TMP"
+}
+
+# what to do in case of user break:
+exitprocedure()
+{
+   g.message -e message='User break!'
+   cleanup
+   exit 1
+}
+
+# shell check for user break (signal list: trap -l)
+trap "exitprocedure" 2 3 15
+
+
+
 #### check if we have awk
 if [ ! -x "`which awk`" ] ; then
     g.message -e "awk required, please install awk or gawk first" 
@@ -116,12 +126,6 @@
 LC_NUMERIC=C
 export LC_NUMERIC
 
-cleanup()
-{
-   #restore settings:
-   g.region region="i.fusion.brovey.$TMP"
-}
-
 TMP=$$
 
 if [ $GIS_FLAG_S -eq 0 -a $GIS_FLAG_L -eq 0 -a $GIS_FLAG_Q -eq 0 ] ; then



More information about the grass-commit mailing list