diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2015-10-20 23:36:56 +0800 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2015-10-20 23:36:56 +0800 |
commit | 53948556ff0bc65339ef13dcb79e0aa8faf7973a (patch) | |
tree | 33dc2f4c42786d6272c92f64c703f5646e1ceeef /Mk | |
parent | efc6bbacda520dfe11d967adc7a47353dc2429cd (diff) | |
download | freebsd-ports-gnome-53948556ff0bc65339ef13dcb79e0aa8faf7973a.tar.gz freebsd-ports-gnome-53948556ff0bc65339ef13dcb79e0aa8faf7973a.tar.zst freebsd-ports-gnome-53948556ff0bc65339ef13dcb79e0aa8faf7973a.zip |
Roll all of the commands into a loop and use the same patterns for every lang.
- /usr/bin/CMD
- /bin/CMD
- /usr/bin/env CMD
With hat: portmgr
Reviewed by: bapt, amdmi3
Differential Revision: https://reviews.freebsd.org/D3942
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/Uses/shebangfix.mk | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/Mk/Uses/shebangfix.mk b/Mk/Uses/shebangfix.mk index cc68c7e3dcf8..d98e52eaf85d 100644 --- a/Mk/Uses/shebangfix.mk +++ b/Mk/Uses/shebangfix.mk @@ -29,44 +29,28 @@ .if !defined(_INCLUDE_USES_SHEBANGFIX_MK) _INCLUDE_USES_SHEBANGFIX_MK= yes -bash_OLD_CMD+= /bin/bash -bash_OLD_CMD+= "/usr/bin/env bash" -bash_CMD?= ${LOCALBASE}/bin/bash -java_OLD_CMD+= /usr/bin/java -java_CMD?= ${LOCALBASE}/bin/java -ksh_OLD_CMD+= /bin/ksh -ksh_CMD?= ${LOCALBASE}/bin/ksh +SHEBANG_LANG+= bash java ksh perl php python ruby tcl tk + .if ${USES:Mlua*} -lua_OLD_CMD+= /usr/bin/lua -lua_OLD_CMD+= "/usr/bin/env lua" +SHEBANG_LANG+= lua lua_CMD?= ${LOCALBASE}/bin/${LUA_CMD} .endif -perl_OLD_CMD+= /usr/bin/perl -perl_OLD_CMD+= "/usr/bin/env perl" -perl_OLD_CMD+= perl -perl_CMD?= ${LOCALBASE}/bin/perl -php_OLD_CMD+= /usr/bin/php -php_CMD?= ${LOCALBASE}/bin/php -python_OLD_CMD+= /usr/bin/python -python_OLD_CMD+= "/usr/bin/env python" + +tcl_CMD?= ${TCLSH} +tk_CMD?= ${WISH} + .if ${USES:Mpython*} python_CMD?= ${PYTHON_CMD} -.else -python_CMD?= ${LOCALBASE}/bin/python .endif -ruby_OLD_CMD+= /usr/bin/ruby -ruby_OLD_CMD+= "/usr/bin/env ruby" -ruby_CMD?= ${LOCALBASE}/bin/ruby -tcl_OLD_CMD+= /usr/bin/tclsh -tcl_CMD?= ${TCLSH} -tk_OLD_CMD+= /usr/bin/wish -tk_CMD?= ${WISH} - -SHEBANG_LANG+= bash java ksh perl php python ruby tcl tk -.if ${USES:Mlua*} -SHEBANG_LANG+= lua -.endif +# Replace the same patterns for all langs and setup a default, that may have +# been set already above with ?=. +.for lang in ${SHEBANG_LANG} +${lang}_CMD?= ${LOCALBASE}/bin/${lang} +${lang}_OLD_CMD+= "/usr/bin/env ${lang}" +${lang}_OLD_CMD+= /bin/${lang} +${lang}_OLD_CMD+= /usr/bin/${lang} +.endfor .for lang in ${SHEBANG_LANG} . if !defined(${lang}_CMD) |