[GRASS-dev] updates to grass startup

Hamish hamish_nospam at yahoo.com
Wed Dec 13 05:59:14 EST 2006


when creating a new location from EPSG code an xterm flashes up and then
disappears. This might have some important info/warning/error in it.

I have prepared the following patch, but not applied it as it makes the
script partially interactive. (ie it asks the user to press <enter> to
continue, but times out in 2 minutes [enough time to find a pen and
write down an error])

So not a great solution, but here it is. 

Better? put a pause at end of exec grass-xterm-wrapper:

lib/init/epsg_option.tcl.in:

exec -- $env(GISBASE)/etc/grass-xterm-wrapper -e \
         $env(GISBASE)/etc/make_location_epsg.sh \
         $epsg_code $epsgLocation $locpath >@stdout 2>@stderr; \
         read -t 120

or somehow like that?


Hamish
-------------- next part --------------
Index: lib/init/make_location_epsg.sh.in
===================================================================
RCS file: /home/grass/grassrepository/grass6/lib/init/make_location_epsg.sh.in,v
retrieving revision 1.1
diff -u -r1.1 make_location_epsg.sh.in
--- lib/init/make_location_epsg.sh.in	24 Apr 2006 09:17:55 -0000	1.1
+++ lib/init/make_location_epsg.sh.in	13 Dec 2006 10:51:59 -0000
@@ -36,9 +36,13 @@
 fi
 
 if test -f $HOME/.gislock$GRASSVERSION ; then
+ echo
  echo "ERROR. GRASS $GRASSVERSION is already running"
  echo "Please close other session first."
  rm -f $HOME/.gislock$GRASSVERSION
+ echo
+ echo "Press <enter> to continue."
+ read -t 120
  #exit 1
 fi
 
@@ -49,8 +53,12 @@
 if [ "$MYGISDBASE" = "" ] ; then
   GISDBASE=`grep GISDBASE $HOME/.$GRASSRC | cut -d' ' -f2`
   if [ "$GISDBASE" = "" ] ; then
+   echo
    echo "ERROR. Cannot get GISDBASE from $HOME/.$GRASSRC"
    echo "Please specify the GISDBASE parameter"
+   echo
+   echo "Press <enter> to continue."
+   read -t 120
    exit 1
   fi
 else
@@ -60,7 +68,10 @@
 GISBASE=`echo $GISBASE | sed "s+'++g"`
 
 if test -d $GISDBASE/$LOCATION ; then
+ echo
  echo "ERROR. Location $LOCATION already exists in $GISDBASE"
+ echo "Press <enter> to continue."
+ read -t 120
  exit 1
 fi
 
@@ -112,10 +123,15 @@
 meters: 1.0" > $GISDBASE/$TEMPDIR/PERMANENT/PROJ_UNITS
 
 # create new location:
+echo
 g.proj -c proj4='+init=epsg:'$EPSG location=$LOCATION
 
 if [ $? -eq 1 ] ; then
+  echo
   echo "An error occured. Stop."
+  echo
+  echo "Press <enter> to continue."
+  read -t 120
   exit 1
 fi
 
@@ -127,6 +143,7 @@
 #cleanup:
 rm -rf $GISDBASE/$TEMPDIR
 
+echo
 echo "Now you can launch GRASS with:"
 echo "   grass$GRASSVERSION $GISDBASE/$LOCATION/PERMANENT"
 echo "and start to import data sets (r.in.gdal -e ... ; v.in.ogr -e ... )."
@@ -135,3 +152,6 @@
 echo "   check with g.proj -w"
 echo "To fix a missing datum definition, either edit the new PROJ_INFO file"
 echo "or carefully run g.proj again inside the new location."
+echo
+echo "Press <enter> to continue."
+read -t 120


More information about the grass-dev mailing list