This is the mail archive of the
mailing list for the eCos project.
Re: #!/usr/bin/env tclsh
- From: Bart Veer <bartv at ecoscentric dot com>
- To: John Dallaway <john at dallaway dot org dot uk>
- Cc: ecos-maintainers at ecos dot sourceware dot org
- Date: Fri, 06 Feb 2009 12:24:21 +0000
- Subject: Re: #!/usr/bin/env tclsh
- References: <496635B7.firstname.lastname@example.org>
>>>>> "John" == John Dallaway <email@example.com> writes:
John> This patch simplifies the #! magic used to invoke Tcl
John> scripts by using "/usr/bin/env tclsh" to find the tclsh
John> executable. Very old Cygwin installations providing only
John> tclsh83.exe or cygtclsh80.exe are no-longer supported.
Actually, this patch has broken things in various ways. Consider e.g.
file2c.tcl in the romfs package. The CDL invokes this using e.g.:
sh file2c.tcl testromfs_le.bin testromfs_le.h
With the old magic this still worked fine because sh would ignore the
#! at the start completely and move on to the 'exec sh -c' on line 3.
With the new '#!/usr/bin/env tclsh' the sh invocation ignores the
#! comment on line 1 so ends up trying to run the whole Tcl script as
a shell script. Needless to say this is not very successful.
io/framebuf is similarly affected. services/memalloc/common is not. I
have not yet checked all the other packages that use Tcl scripts.
Possible solutions are:
1) revert the change
2) remove the 'sh' bits from the relevant CDL scripts, treating the
Tcl script as plain executables.
3) make the CDL invoke /usr/bin/env tclsh directly, treating the
Tcl scripts as Tcl scripts.
(1) would be a bad move. I think I would prefer (3) to (2).
Bart Veer eCos Configuration Architect
eCosCentric Limited The eCos experts http://www.ecoscentric.com/
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
Besuchen Sie uns vom 3.-5.03.09 auf der Embedded World 2009, Stand 11-300
Visit us at Embedded World 2009, Nürnberg, Germany, 3-5 Mar, Stand 11-300