After some discussion with Vadim Zhukov (takes 3 and 4)
and reviewing everything everyone else said.
Stu
Index: tcl.port.mk
===================================================================
RCS file: /cvs/ports/lang/tcl/tcl.port.mk,v
retrieving revision 1.14
diff -u -p -u -p -r1.14 tcl.port.mk
--- tcl.port.mk 2 Feb 2013 11:15:33 -0000 1.14
+++ tcl.port.mk 15 Jun 2013 04:01:17 -0000
@@ -34,13 +34,12 @@ MODTCL_WANTLIB ?= ${MODTCL_LIB}
# Set 'tclsh' for executable scripts (in-place modification).
MODTCL_TCLSH_ADJ = perl -pi \
- -e '$$. == 1 && s!env (tclsh|wish).*$$!env
tclsh${MODTCL_VERSION}!;' \
- -e '$$. >= 3 && $$. <= 30 && s!exec
(tclsh|wish).*$$!exec tclsh${MODTCL_VERSION} "\$$0" \$${1+"\$$@"}!;' \
- -e 'close ARGV if eof;'
+ -e '$$. == 1 &&
s!/\S*(?:/env\s+|bin/)(?:tcl|wi)sh\S*(\s+.+)?$$!${MODTCL_BIN}$$1!;' \
+ -e '$$. >= 3 && $$. <= 30 && s!exec\s+(?:tcl|wi)sh.*$$!exec
${MODTCL_BIN} "\$$0" \$${1+"\$$@"}!;' \
+ -e 'close ARGV if eof;'
# Set 'wish' for executable scripts (in-place modification).
-MODTCL_WISH_ADJ =
${MODTCL_TCLSH_ADJ:S/tclsh${MODTCL_VERSION}/wish${MODTCL_VERSION}/}
+MODTCL_WISH_ADJ = ${MODTCL_TCLSH_ADJ:S/tclsh/wish/}
SUBST_VARS += MODTCL_VERSION MODTCL_BIN
-