Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148022149
D3942.id9538.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3942.id9538.diff
View Options
Index: head/Mk/Uses/shebangfix.mk
===================================================================
--- head/Mk/Uses/shebangfix.mk
+++ head/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)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 16, 5:56 AM (8 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29756739
Default Alt Text
D3942.id9538.diff (1 KB)
Attached To
Mode
D3942: Remove all of the duplicated logic in shebangfix.
Attached
Detach File
Event Timeline
Log In to Comment