So here is a second try, after input from stu@. Differences from previous version:
* More compact and correct whitespace handling (with some ideas from stu@'s diff); * Rewrite both tclsh and wish lines in both macros; * Use MODTCL_BIN also for rewritting "exec" lines in shell snippets; * Do not move _WISH_ADJ macro to x11/tk module (shrinks diff a lot). Comments/okays? -- WBR, Vadim Zhukov Index: lang/tcl/tcl.port.mk =================================================================== RCS file: /cvs/ports/lang/tcl/tcl.port.mk,v retrieving revision 1.14 diff -u -p -r1.14 tcl.port.mk --- lang/tcl/tcl.port.mk 2 Feb 2013 11:15:33 -0000 1.14 +++ lang/tcl/tcl.port.mk 27 May 2013 18:20:06 -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;' - -# Set 'wish' for executable scripts (in-place modification). -MODTCL_WISH_ADJ = ${MODTCL_TCLSH_ADJ:S/tclsh${MODTCL_VERSION}/wish${MODTCL_VERSION}/} + -e '$$. == 1 && s!/\S*bin/(?:tcl|wi)sh\S*(\s.*)?$$!${MODTCL_BIN}$$1!;' \ + -e '$$. == 1 && s!/\S*env\s+(?:tcl|wi)sh\S*(\s.*)?$$!${MODTCL_BIN}$$1!;' \ + -e '$$. >= 3 && $$. <= 30 && s!exec (?:tcl|wi)sh.*$$!exec ${MODTCL_BIN} "\$$0" \$${1+"\$$@"}!;' \ + -e 'close ARGV if eof;' +MODTCL_WISH_ADJ = ${MODTCL_TCLSH_ADJ:S/tclsh/wish/g} SUBST_VARS += MODTCL_VERSION MODTCL_BIN Index: audio/xcd/Makefile =================================================================== RCS file: /cvs/ports/audio/xcd/Makefile,v retrieving revision 1.28 diff -u -p -r1.28 Makefile --- audio/xcd/Makefile 10 Mar 2013 22:55:06 -0000 1.28 +++ audio/xcd/Makefile 27 May 2013 18:20:06 -0000 @@ -2,7 +2,7 @@ COMMENT = Tcl/Tk CD player DISTNAME = xcd-1.7 -REVISION = 3 +REVISION = 4 CATEGORIES = audio MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> Index: audio/snack/Makefile =================================================================== RCS file: /cvs/ports/audio/snack/Makefile,v retrieving revision 1.10 diff -u -p -r1.10 Makefile --- audio/snack/Makefile 10 Mar 2013 22:55:05 -0000 1.10 +++ audio/snack/Makefile 27 May 2013 18:20:06 -0000 @@ -9,7 +9,7 @@ PKGNAME-main = snack-${MODPY_EGG_VERSIO PKGNAME-python = py-snack-${MODPY_EGG_VERSION} CATEGORIES = audio -REVISION-main = 3 +REVISION-main = 4 REVISION-python =1 HOMEPAGE = http://www.speech.kth.se/snack Index: devel/tclcl/Makefile =================================================================== RCS file: /cvs/ports/devel/tclcl/Makefile,v retrieving revision 1.28 diff -u -p -r1.28 Makefile --- devel/tclcl/Makefile 11 Mar 2013 10:50:31 -0000 1.28 +++ devel/tclcl/Makefile 27 May 2013 18:20:06 -0000 @@ -7,6 +7,7 @@ DISTNAME= tclcl-src-$V PKGNAME= tclcl-$V CATEGORIES= devel MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> +REVISION = 0 HOMEPAGE= http://otcl-tclcl.sourceforge.net/tclcl/ Index: devel/tcllib/Makefile =================================================================== RCS file: /cvs/ports/devel/tcllib/Makefile,v retrieving revision 1.17 diff -u -p -r1.17 Makefile --- devel/tcllib/Makefile 11 Mar 2013 10:50:31 -0000 1.17 +++ devel/tcllib/Makefile 27 May 2013 18:20:06 -0000 @@ -6,6 +6,7 @@ DISTNAME = tcllib-1.14 CATEGORIES = devel lang/tcl HOMEPAGE = http://sourceforge.net/projects/tcllib/ MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> +REVISION = 0 # BSD style PERMIT_PACKAGE_CDROM = Yes Index: devel/tkcvs/Makefile =================================================================== RCS file: /cvs/ports/devel/tkcvs/Makefile,v retrieving revision 1.30 diff -u -p -r1.30 Makefile --- devel/tkcvs/Makefile 11 Mar 2013 10:50:31 -0000 1.30 +++ devel/tkcvs/Makefile 27 May 2013 18:20:06 -0000 @@ -2,7 +2,7 @@ COMMENT= graphical frontend to CVS DISTNAME= tkcvs-6.0 -REVISION = 3 +REVISION = 4 CATEGORIES= devel MAINTAINER= Todd T. Fries <t...@openbsd.org> Index: devel/tkdiff/Makefile =================================================================== RCS file: /cvs/ports/devel/tkdiff/Makefile,v retrieving revision 1.13 diff -u -p -r1.13 Makefile --- devel/tkdiff/Makefile 11 Mar 2013 10:50:31 -0000 1.13 +++ devel/tkdiff/Makefile 27 May 2013 18:20:06 -0000 @@ -4,6 +4,7 @@ COMMENT= graphical front-end to the diff DISTNAME= tkdiff-4.2 CATEGORIES= devel sysutils +REVISION= 0 HOMEPAGE= http://tkdiff.sourceforge.net/ Index: devel/tklib/Makefile =================================================================== RCS file: /cvs/ports/devel/tklib/Makefile,v retrieving revision 1.8 diff -u -p -r1.8 Makefile --- devel/tklib/Makefile 11 Mar 2013 10:50:31 -0000 1.8 +++ devel/tklib/Makefile 27 May 2013 18:20:06 -0000 @@ -3,7 +3,7 @@ COMMENT = Tk Standard Library DISTNAME = tklib-0.5 -REVISION = 1 +REVISION = 2 CATEGORIES= devel x11/tk HOMEPAGE = http://sourceforge.net/projects/tcllib/ MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> Index: devel/wcb/Makefile =================================================================== RCS file: /cvs/ports/devel/wcb/Makefile,v retrieving revision 1.4 diff -u -p -r1.4 Makefile --- devel/wcb/Makefile 11 Mar 2013 10:50:31 -0000 1.4 +++ devel/wcb/Makefile 27 May 2013 18:20:06 -0000 @@ -8,6 +8,7 @@ PKGNAME = $N-3.4 CATEGORIES = devel HOMEPAGE = http://www.nemethi.de/ MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> +REVISION = 0 # ISC style PERMIT_PACKAGE_CDROM = Yes Index: devel/mentry/Makefile =================================================================== RCS file: /cvs/ports/devel/mentry/Makefile,v retrieving revision 1.4 diff -u -p -r1.4 Makefile --- devel/mentry/Makefile 11 Mar 2013 10:50:11 -0000 1.4 +++ devel/mentry/Makefile 27 May 2013 18:20:06 -0000 @@ -8,12 +8,13 @@ PKGNAME = $N-3.6 CATEGORIES = devel HOMEPAGE = http://www.nemethi.de/ MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> +REVISION = 0 # ISC style PERMIT_PACKAGE_CDROM = Yes MASTER_SITES = ${HOMEPAGE:=$N/} -MODULES = lang/tcl +MODULES = x11/tk RUN_DEPENDS = devel/wcb NO_BUILD = Yes NO_TEST = Yes Index: devel/nagelfar/Makefile =================================================================== RCS file: /cvs/ports/devel/nagelfar/Makefile,v retrieving revision 1.2 diff -u -p -r1.2 Makefile --- devel/nagelfar/Makefile 11 Mar 2013 10:50:12 -0000 1.2 +++ devel/nagelfar/Makefile 27 May 2013 18:20:06 -0000 @@ -7,6 +7,7 @@ PKGNAME = nagelfar-1.1.12 CATEGORIES = devel HOMEPAGE = http://nagelfar.berlios.de/ MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> +REVISION = 0 # GPLv2 (Nagelfar) # BSD (textSearch) Index: graphics/colorexplorer/Makefile =================================================================== RCS file: /cvs/ports/graphics/colorexplorer/Makefile,v retrieving revision 1.6 diff -u -p -r1.6 Makefile --- graphics/colorexplorer/Makefile 11 Mar 2013 11:10:51 -0000 1.6 +++ graphics/colorexplorer/Makefile 27 May 2013 18:20:06 -0000 @@ -3,7 +3,7 @@ COMMENT = tool for exploring the color space and relations DISTNAME = ColorExplorer-1.8 -REVISION = 1 +REVISION = 2 CATEGORIES = graphics HOMEPAGE = http://billposer.org/Software/ColorExplorer.html MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> Index: net/amsn/Makefile =================================================================== RCS file: /cvs/ports/net/amsn/Makefile,v retrieving revision 1.26 diff -u -p -r1.26 Makefile --- net/amsn/Makefile 11 Mar 2013 11:35:45 -0000 1.26 +++ net/amsn/Makefile 27 May 2013 18:20:06 -0000 @@ -5,7 +5,7 @@ COMMENT= open source MSN Messenger clone V= 0.98.9 DISTNAME= amsn-$V-src PKGNAME= ${DISTNAME:S/-src//} -REVISION= 2 +REVISION= 3 CATEGORIES= net HOMEPAGE= http://www.amsn-project.net/ Index: net/coccinella/Makefile =================================================================== RCS file: /cvs/ports/net/coccinella/Makefile,v retrieving revision 1.16 diff -u -p -r1.16 Makefile --- net/coccinella/Makefile 11 Mar 2013 11:35:45 -0000 1.16 +++ net/coccinella/Makefile 27 May 2013 18:20:06 -0000 @@ -4,7 +4,7 @@ SHARED_ONLY = Yes COMMENT = XMPP client with whiteboard -REVISION = 3 +REVISION = 4 DISTNAME = Coccinella-0.96.20Binfree PKGNAME = ${DISTNAME:S/Binfree$//:L} CATEGORIES = net Index: net/tkirc/Makefile =================================================================== RCS file: /cvs/ports/net/tkirc/Makefile,v retrieving revision 1.15 diff -u -p -r1.15 Makefile --- net/tkirc/Makefile 11 Mar 2013 11:35:57 -0000 1.15 +++ net/tkirc/Makefile 27 May 2013 18:20:06 -0000 @@ -4,7 +4,7 @@ COMMENT= ircII internet relay chat clien DISTNAME= tkirc2.46 PKGNAME= tkirc-2.46 -REVISION= 1 +REVISION= 2 CATEGORIES= net HOMEPAGE= http://netsplit.de/tkirc2/ Index: lang/tcltutor/Makefile =================================================================== RCS file: /cvs/ports/lang/tcltutor/Makefile,v retrieving revision 1.8 diff -u -p -r1.8 Makefile --- lang/tcltutor/Makefile 11 Mar 2013 11:20:28 -0000 1.8 +++ lang/tcltutor/Makefile 27 May 2013 18:20:06 -0000 @@ -6,6 +6,7 @@ DISTNAME = tcltutor-30b6 CATEGORIES = lang lang/tcl HOMEPAGE = http://www.msen.com/~clif/TclTutor.html MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> +REVISION = 0 # ISC PERMIT_PACKAGE_CDROM = Yes Index: misc/impress/Makefile =================================================================== RCS file: /cvs/ports/misc/impress/Makefile,v retrieving revision 1.13 diff -u -p -r1.13 Makefile --- misc/impress/Makefile 11 Mar 2013 11:23:57 -0000 1.13 +++ misc/impress/Makefile 27 May 2013 18:20:06 -0000 @@ -4,7 +4,7 @@ COMMENT= publishing and presentation too VERSION= 1.1b9 DISTNAME= impress-${VERSION} -REVISION= 0 +REVISION= 1 DISTFILES= imp${VERSION}.tar.gz CATEGORIES= misc Index: misc/remind/Makefile =================================================================== RCS file: /cvs/ports/misc/remind/Makefile,v retrieving revision 1.31 diff -u -p -r1.31 Makefile --- misc/remind/Makefile 11 Mar 2013 11:23:58 -0000 1.31 +++ misc/remind/Makefile 27 May 2013 18:20:06 -0000 @@ -5,6 +5,7 @@ COMMENT= scripting language for reminder DISTNAME= remind-03.01.12 PKGNAME= remind-3.1.12 CATEGORIES= misc +REVISION= 0 MASTER_SITES= http://www.roaringpenguin.com/files/download/ Index: misc/tkcron/Makefile =================================================================== RCS file: /cvs/ports/misc/tkcron/Makefile,v retrieving revision 1.21 diff -u -p -r1.21 Makefile --- misc/tkcron/Makefile 11 Mar 2013 11:23:58 -0000 1.21 +++ misc/tkcron/Makefile 27 May 2013 18:20:06 -0000 @@ -3,7 +3,7 @@ COMMENT = Tk frontend to crontab DISTNAME = tkcron-2.12 -REVISION = 0 +REVISION = 1 CATEGORIES = misc MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> Index: misc/tkinfo/Makefile =================================================================== RCS file: /cvs/ports/misc/tkinfo/Makefile,v retrieving revision 1.25 diff -u -p -r1.25 Makefile --- misc/tkinfo/Makefile 11 Mar 2013 11:23:58 -0000 1.25 +++ misc/tkinfo/Makefile 27 May 2013 18:20:06 -0000 @@ -3,7 +3,7 @@ COMMENT = read and display GNU info files in Tk DISTNAME = tkinfo-2.8 -REVISION = 1 +REVISION = 2 CATEGORIES = misc HOMEPAGE = http://math-www.uni-paderborn.de/~axel/tkinfo/ MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> Index: misc/tkman/Makefile =================================================================== RCS file: /cvs/ports/misc/tkman/Makefile,v retrieving revision 1.24 diff -u -p -r1.24 Makefile --- misc/tkman/Makefile 11 Mar 2013 11:23:58 -0000 1.24 +++ misc/tkman/Makefile 27 May 2013 18:20:06 -0000 @@ -6,6 +6,7 @@ DISTNAME = tkman-2.2 CATEGORIES = misc HOMEPAGE = http://www.sourceforge.net/projects/tkman MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> +REVISION = 0 # Artistic License PERMIT_PACKAGE_CDROM = Yes Index: productivity/sl/Makefile =================================================================== RCS file: /cvs/ports/productivity/sl/Makefile,v retrieving revision 1.2 diff -u -p -r1.2 Makefile --- productivity/sl/Makefile 16 Mar 2013 13:25:21 -0000 1.2 +++ productivity/sl/Makefile 27 May 2013 18:20:06 -0000 @@ -3,6 +3,7 @@ COMMENT = substantially more useful ls DISTNAME = sl-ls-1.1.2 CATEGORIES = productivity sysutils +REVISION = 0 HOMEPAGE = http://practicalthought.com/sl/ @@ -21,8 +22,7 @@ NO_BUILD = Yes NO_TEST = Yes pre-configure: -# XXX: Use ${MODTCL_TCLSH_ADJ} someday - perl -pi -e s,/usr/bin/tclsh,${PREFIX}/bin/tclsh${MODTCL_VERSION},g ${WRKSRC}/sl + ${MODTCL_TCLSH_ADJ} ${WRKSRC}/sl do-install: ${INSTALL_SCRIPT} ${WRKSRC}/sl ${PREFIX}/bin Index: security/password-gorilla/Makefile =================================================================== RCS file: /cvs/ports/security/password-gorilla/Makefile,v retrieving revision 1.3 diff -u -p -r1.3 Makefile --- security/password-gorilla/Makefile 11 Mar 2013 11:41:27 -0000 1.3 +++ security/password-gorilla/Makefile 27 May 2013 18:20:06 -0000 @@ -3,7 +3,7 @@ COMMENT = cross-platform password manager V = 1.5.3.6.3 -REVISION = 0 +REVISION = 1 DISTNAME = zdia-gorilla-v${V}-0-gfc80d95 PKGNAME = password-gorilla-${V} CATEGORIES = security Index: www/august/Makefile =================================================================== RCS file: /cvs/ports/www/august/Makefile,v retrieving revision 1.23 diff -u -p -r1.23 Makefile --- www/august/Makefile 13 Mar 2013 21:44:35 -0000 1.23 +++ www/august/Makefile 27 May 2013 18:20:06 -0000 @@ -4,7 +4,7 @@ COMMENT= html editor designed for the ex DISTNAME= august0.63b.src PKGNAME= august-0.63b -REVISION= 1 +REVISION= 2 CATEGORIES= www HOMEPAGE= http://www.erjobe.info/index.php?n=Main.August Index: x11/bwidget/Makefile =================================================================== RCS file: /cvs/ports/x11/bwidget/Makefile,v retrieving revision 1.10 diff -u -p -r1.10 Makefile --- x11/bwidget/Makefile 11 Mar 2013 11:46:08 -0000 1.10 +++ x11/bwidget/Makefile 27 May 2013 18:20:06 -0000 @@ -6,6 +6,7 @@ DISTNAME = bwidget-1.9.5 CATEGORIES = x11 HOMEPAGE = http://sourceforge.net/projects/tcllib/ MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> +REVISION = 0 # BSD style PERMIT_PACKAGE_CDROM = Yes Index: x11/tkcon/Makefile =================================================================== RCS file: /cvs/ports/x11/tkcon/Makefile,v retrieving revision 1.7 diff -u -p -r1.7 Makefile --- x11/tkcon/Makefile 11 Mar 2013 11:46:16 -0000 1.7 +++ x11/tkcon/Makefile 27 May 2013 18:20:06 -0000 @@ -3,7 +3,7 @@ COMMENT = enhanced Tk console DISTNAME = tkcon-2.5 -REVISION = 0 +REVISION = 1 CATEGORIES = x11 x11/tk HOMEPAGE = http://sourceforge.net/projects/tkcon/ MAINTAINER = Stuart Cassoff <s...@users.sourceforge.net> Index: x11/tkdnd/Makefile =================================================================== RCS file: /cvs/ports/x11/tkdnd/Makefile,v retrieving revision 1.4 diff -u -p -r1.4 Makefile --- x11/tkdnd/Makefile 11 Mar 2013 11:46:16 -0000 1.4 +++ x11/tkdnd/Makefile 27 May 2013 18:20:06 -0000 @@ -4,7 +4,7 @@ SHARED_ONLY = Yes COMMENT = drag n drop extension for Tk -REVISION = 1 +REVISION = 2 DISTNAME = tkdnd-1.0a2 SHARED_LIBS = tkdnd 0.0 CATEGORIES = x11 Index: x11/tktable/Makefile =================================================================== RCS file: /cvs/ports/x11/tktable/Makefile,v retrieving revision 1.27 diff -u -p -r1.27 Makefile --- x11/tktable/Makefile 11 Mar 2013 11:46:16 -0000 1.27 +++ x11/tktable/Makefile 27 May 2013 18:20:06 -0000 @@ -6,7 +6,7 @@ DOTVER = 2.10 VER = ${DOTVER:S/.//} DISTNAME = Tktable${DOTVER} PKGNAME = Tktable-${DOTVER} -REVISION = 1 +REVISION = 2 SHARED_LIBS = Tktable${VER} 0.0 CATEGORIES = x11 HOMEPAGE = http://tktable.sourceforge.net/ Index: x11/tktreectrl/Makefile =================================================================== RCS file: /cvs/ports/x11/tktreectrl/Makefile,v retrieving revision 1.12 diff -u -p -r1.12 Makefile --- x11/tktreectrl/Makefile 11 Mar 2013 11:46:16 -0000 1.12 +++ x11/tktreectrl/Makefile 27 May 2013 18:20:06 -0000 @@ -9,6 +9,7 @@ SHARED_LIBS = treectrl24 0.0 CATEGORIES = x11 HOMEPAGE = http://tktreectrl.sourceforge.net/ MAINTAINER = Sebastian Reitenbach <sebas...@openbsd.org> +REVISION = 0 # BSD PERMIT_PACKAGE_CDROM = Yes Index: x11/xbindkeys/Makefile =================================================================== RCS file: /cvs/ports/x11/xbindkeys/Makefile,v retrieving revision 1.15 diff -u -p -r1.15 Makefile --- x11/xbindkeys/Makefile 11 Mar 2013 11:46:17 -0000 1.15 +++ x11/xbindkeys/Makefile 27 May 2013 18:20:06 -0000 @@ -3,6 +3,7 @@ COMMENT = bind keys or mouse buttons to shell commands under X11 DISTNAME = xbindkeys-1.8.5 CATEGORIES = x11 +REVISION = 0 HOMEPAGE = http://www.nongnu.org/xbindkeys/xbindkeys.html