[GRASS-dev] gis.m patch

Glynn Clements glynn at gclements.plus.com
Mon Sep 4 22:46:10 EDT 2006


Huidae Cho wrote:

> > > > This is GREAT. Thanks very much. I have a couple questions.
> > > > 
> > > > 1. Is there a binary version of this available for people to try?
> > > 
> > > No, not yet.  Since the native winGRASS runs on MSys, users need to
> > > install various MSys/GnuWin32 packages as well as GRASS.  I want to
> > > distribute a whole system including MSys/GnuWin32 binaries, but I'm not
> > > sure about license issues related to redistribution.  It looks like most
> > > of packages are under GPL licenses, so can I?  It could be really
> > > annoying for non-techy users to choose right packages from their sites
> > > (it's not like Cygwin).
> > 
> > Most of the packages you are likely to need will allow bundling with
> > GRASS in a single installer or archive.
> > 
> > The only case which might be problematic is if you are using
> > ActiveState Tcl/Tk; the licencing conditions for that looked like they
> > might be problematic, so I've been using the standard Tcl/Tk packages
> > built from source instead.
> 
> Then the MSys version should be fine?

Probably. I didn't actually realise there *was* an MSys version until
you mentioned it.

> > > > 3. Could you give me a brief one-liner of what each change to gism is
> > > > intended to do so I can find a way to keep this in the code if it does have
> > > > issues on other platforms?
> > > 
> > > As mentioned above, the only problem was the null device.  On Windows,
> > > it's called "nul" and that's the only change that I made.
> > 
> > There is also this one:
> > 
> > 	# Actually run the program
> > 	- set cmd [concat | $cmd 2>@ stdout]
> > 	+ if { $mingw == "1" } {
> > 	+  set cmd [concat | $cmd]
> > 	+ } {
> > 	+  set cmd [concat | $cmd 2>@ stdout]
> > 	+ }
> > 
> > What happens without that change?
> 
> I get the same error as http://intevation.de/rt/webrt?serial_num=5096.
> $ret is set to 1 and it cannot make it to $execcmd.

Odd. Or maybe not; assuming that there even *is* a stdout is a bad
idea for a Windows program, particularly as gis.m runs itself in the
background by default.

The problem with simply removing the "2>@ stdout" is that "exec"
generates an error if the command writes anything to an unredirected
stderr.

It might be better to unconditionally use:

	set cmd [concat | $cmd |& cat]

so that both stdout and stderr go to the console widget (AFAIK, Tcl's
exec/open don't provide an equivalent of "2>&1").

Also, on Unix the 2>@stdout may cause gis.m to be suspended (with
SIGTTOU) if the TOSTOP mode ("stty tostop") is in force.

In any case, bug #5096 indicates that there is an error in the
error-handling code in gronsole.tcl. That needs to be fixed regardless
of how stderr is handled; there are other reasons why open might fail.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list