[GRASS-dev] [GRASS-user] why is v.build.all (and many others) a windows batch file and not an executable?

Helmut Kudrnovsky hellik at web.de
Sat Apr 30 22:59:21 PDT 2016


Markus Neteler wrote
> (moved temporarily here for catching expert answers, then I'll
> transfer the result to grass-user to avoid cross-posting)
> 
> The point is that the user wants to run without extra hassle
> (parameter updates are ok of course) existing G6 scripts in a G7
> session on Windows:
> 
> ------- start fwd -------
> On Sat, Apr 30, 2016 at 10:53 AM, Bartolomei.Chris  wrote:
>> Ok (I guess) but this causes severe problems running shell scripts that
>> call out the GRASS modules ... there is no way of knowing which modules
>> are compiled executables (which run fine from the shell script) and which
>> ones are Windows Batch files (which DON'T run when called from a script)
>> ... unless you run the script and figure out which modules make it crash. 
>> If you look in the bin directory, you'll see a mix of both ... for
>> example r.mask, v.build.all and v.db.addcolumn are Windows Batch files
>> which you can''t run from a shell script - you have to add the "python
>> {path to script}/{script}.py" to run it whereas in the same bin directory
>> v.build, v.clean, r.what, etc are compiled executables.
>> This is really really (really) bad.  There are a lot of legacy shell
>> scripts that will need extensive rewriting for which there are no
>> resources to do. It's bad enough that msys is gone, the topology is no
>> longer valid (have to update all data), a large amount of the module
>> syntax options have changed, and so on ... for me all of this grief is
>> because v.net doesn't snap points to the network and the fix (in v7)
>> won't be ported to v6.4.4 .... They modules should all be compiled
>> executables so legacy shell scripts users have can run them ... please
>> make at least ONE thing about this "upgrade" semi-straightforward. It's
>> been a nightmare.
> ------- end fwd -------
> 
> I hope someone can give suggestions here.
> 
> thanks
> Markus
> __________________________

I haven't a closer look at this issue. 

AFAIU it may be a path issue: the path to the script folder isn't exported
to path. 

in winGRASS 7 only the bin-folder is visible in %PATH%, as we put there the
wrapper bat-files, which invokes the script with the own shipped python
interpreter (=GRASS_PYTHON variable).

the reason for this wrapper bat files is to use the winGRASS shipped python
interpreter and not the system wide which may be incompatible. 

for this issue with shell scripts in msys, it should be looked first what is
in %PATH%/$PATH and may be missing; and which variables (e.g.
GRASS_PYTHON,...) are set. 



-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Re-GRASS-user-why-is-v-build-all-and-many-others-a-windows-batch-file-and-not-an-executable-tp5263689p5263712.html
Sent from the Grass - Dev mailing list archive at Nabble.com.


More information about the grass-dev mailing list