[GRASS-dev] fixes before 6.2.1 [was: ps.map: scale wrong and no output]

Michael Barton michael.barton at asu.edu
Sat Nov 18 12:41:20 EST 2006


I've been tied up with a visiting speaker and haven't had time to read email
or check on TclTk-C interaction. I'll try to get to  it soon.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton



> From: Hamish <hamish_nospam at yahoo.com>
> Date: Sat, 18 Nov 2006 21:05:36 +1300
> To: Michael Barton <michael.barton at asu.edu>
> Cc: <grass-dev at grass.itc.it>
> Subject: Re: [GRASS-dev] fixes before 6.2.1 [was: ps.map: scale wrong and no
> output]
> 
> Michael Barton wrote:
>> The only possible outstanding bug is the slightly misleading error
>> message generated when the GUI fails to start up because gdal is not
>> installed or incorrectly installed. However, in discussions with
>> Hamish, it is looking like this would be better trapped before the GUI
>> tries to launch.
> 
> I wrote [offlist]:
> re gis.m failing on startup with "parts(n)" error if libgdal is missing-
> 
> I get it now, so by that point g.region is history and we are dealing
> with the downstream effects of the failure. It's informative /where/ it
> broke for debugging by us, but not /why/ for self-debugging by the user.
> Optimally we want to pick up and regurgitate the "libgdal.so not found"
> message somehow.
> 
> did you figure out how to get the return code from a C module in tcl?
> (like "$?" in bash scripts) to test if the module exited with an error
> or not? [=0 is success, =something else is failure]
> 
> like $GISBASE/etc/grass-run.sh tests.
> 
> [see end of http://wiki.tcl.tk/902 ]
> 
> 
> or maybe test that the values of n,s,e,w are not empty directly after
> the g.region call?
> 
> mapcanvas.tcl: line 1035
> 
> # Zoom to something loaded from a g.region command
> proc MapCanvas::zoom_gregion {mon args} {
> global env
> 
> if {![catch {open [concat "|g.region" "-ug" $args] r} input]} {
> while {[gets $input line] >= 0} {
> regexp -nocase {^([a-z]+)=(.*)$} $line trash key value
> set parts($key) $value
> }
> catch {close $input}
> 
> MapCanvas::zoom_new $mon $parts(n) $parts(s) $parts(e) \
> $parts(w) $parts(nsres) $parts(ewres)
> 
> }
> }
> 
> I don't fully understand the catch- does it get stderr?:
>  http://www.wellho.net/mouth/366_Error-handling-in-Tcl-through-catch.html
> 
> 
> or maybe the solution is to run a tiny do-nothing C program at start up
> which depends on all the compiled-in libraries that were configured
> during the build step?
> [...]
> a little program for Init.sh that needs the core rast,vect,proj libraries:
>  $(VECTLIB) $(GPROJLIB) $(GISLIB)
> 
> Init.sh before starting the GUI:
> "$GISBASE"/etc/g.testlibs
> if [ $? -ne 0 ] ; then
>    echo "library failure of some sort. please fix." >&2
>    exit 1
> fi
> 
> 
> Hamish




More information about the grass-dev mailing list