From owner-svn-ports-head@freebsd.org Tue Oct 20 15:36:58 2015 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3E70A19148; Tue, 20 Oct 2015 15:36:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A1EC32D; Tue, 20 Oct 2015 15:36:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9KFauxi073269; Tue, 20 Oct 2015 15:36:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9KFauLL073268; Tue, 20 Oct 2015 15:36:56 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510201536.t9KFauLL073268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 20 Oct 2015 15:36:56 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r399863 - head/Mk/Uses X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2015 15:36:58 -0000 Author: bdrewery Date: Tue Oct 20 15:36:56 2015 New Revision: 399863 URL: https://svnweb.freebsd.org/changeset/ports/399863 Log: 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 Modified: head/Mk/Uses/shebangfix.mk Modified: head/Mk/Uses/shebangfix.mk ============================================================================== --- head/Mk/Uses/shebangfix.mk Tue Oct 20 15:33:31 2015 (r399862) +++ head/Mk/Uses/shebangfix.mk Tue Oct 20 15:36:56 2015 (r399863) @@ -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)