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

Glynn Clements glynn at gclements.plus.com
Thu May 5 11:25:14 PDT 2016


Bartolomei.Chris wrote:

> While I think that there could have been a way to move forward with
> python and yet not break the legacy shell scripts users have when
> migrating, I understand the changes now.

If MSys treats other shell scripts as executables, one option might be
to auto-generate a shell-script wrapper for each Python script, in the
same way that batch-file wrappers are generated.

The batch-file wrappers are generated by a rule in Script.make:

$(BIN)/$(PGM).bat: $(MODULE_TOPDIR)/scripts/windows_launch.bat
	sed -e "s#SCRIPT_NAME#$(PGM)#" -e "s#SCRIPT_DIR#$(SCRIPT_DIR)#" $(MODULE_TOPDIR)/scripts/windows_launch.bat > $@
	unix2dos $@

This is run as part of the process of "building" a script; it just
takes a template .bat file and inserts the script name and directory. 

It would be a straightfoward matter to add a similar rule to do the
same for a shell script; the only question is whether this should be
done automatically and whether the wrappers should go into the bin
directory or some other directory (it depends upon whether they will
interfere with contexts other than shell scripts).

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


More information about the grass-user mailing list