From owner-svn-ports-all@freebsd.org Tue Jul 17 12:00:47 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15585103CA34; Tue, 17 Jul 2018 12:00:47 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC0A185D63; Tue, 17 Jul 2018 12:00:46 +0000 (UTC) (envelope-from antoine@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EC2F30E8; Tue, 17 Jul 2018 12:00:46 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6HC0kqr097831; Tue, 17 Jul 2018 12:00:46 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6HC0kT1097830; Tue, 17 Jul 2018 12:00:46 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201807171200.w6HC0kT1097830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Tue, 17 Jul 2018 12:00:46 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r474794 - head/Mk/Uses X-SVN-Group: ports-head X-SVN-Commit-Author: antoine X-SVN-Commit-Paths: head/Mk/Uses X-SVN-Commit-Revision: 474794 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2018 12:00:47 -0000 Author: antoine Date: Tue Jul 17 12:00:46 2018 New Revision: 474794 URL: https://svnweb.freebsd.org/changeset/ports/474794 Log: Fix logic in lua version selection Reviewed by: bapt, mat Differential Revision: https://reviews.freebsd.org/D16275 Modified: head/Mk/Uses/lua.mk Modified: head/Mk/Uses/lua.mk ============================================================================== --- head/Mk/Uses/lua.mk Tue Jul 17 10:30:24 2018 (r474793) +++ head/Mk/Uses/lua.mk Tue Jul 17 12:00:46 2018 (r474794) @@ -24,7 +24,15 @@ IGNORE= Invalid lua version ${LUA_DEFAULT} # .if ${lua_ARGS:M*+} _LUA_MIN_VERSION:= ${lua_ARGS:M*+:S/+//} -_LUA_WANTED_VERSION:= ${_LUA_DEFAULT_VERSION} +# +# Resolve minimum versions (ver+). Append anything greater or equal than the +# specified minimum version to the list of wanted versions. +# +. for _v in ${_LUA_VALID_VERSIONS} +. if ${_LUA_MIN_VERSION} <= ${_v} +_LUA_WANTED_VERSIONS+=${_v} +. endif +. endfor .endif # @@ -43,18 +51,6 @@ _LUA_WANTED_VERSIONS= ${_LUA_DEFAULT_VERSION} .endif # -# Resolve minimum versions (ver+). Append anything greater or equal than the -# specified minimum version to the list of wanted versions. -# -.if defined(_LUA_MIN_VERSION) -. for _v in ${_LUA_VALID_VERSIONS} -. if ${_LUA_MIN_VERSION} <= ${_v} -_LUA_WANTED_VERSIONS+=${_v} -. endif -. endfor -.endif - -# # Right now we have built a list of potential versions that we may depend on. # Let's sort them and remove any duplicates. We then locate the highest one # already installed, if any. @@ -62,14 +58,20 @@ _LUA_WANTED_VERSIONS+=${_v} .for _v in ${_LUA_WANTED_VERSIONS:O:u} _LUA_HIGHEST_VERSION:=${_v} . if exists(${LOCALBASE}/bin/lua${_v}) -_LUA_WANTED_VERSION:= ${_v} +_LUA_HIGHEST_INSTALLED_VERSION:= ${_v} . endif .endfor # -# If we couldn't find any wanted version installed, depend on the highest one. -.if !defined(_LUA_WANTED_VERSION) -_LUA_WANTED_VERSION:= ${_LUA_HIGHEST_VERSION} +# Depend on the default version if it fits, or the highest installed version, +# or the highest version. +# +.if ${_LUA_WANTED_VERSIONS:M${_LUA_DEFAULT_VERSION}} +_LUA_WANTED_VERSION:= ${_LUA_DEFAULT_VERSION} +.elif defined(_LUA_HIGHEST_INSTALLED_VERSION) +_LUA_WANTED_VERSION:= ${_LUA_HIGHEST_INSTALLED_VERSION} +.else +_LUA_WANTED_VERSION:= ${_LUA_HIGHEST_VERSION} .endif #