Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110431884
D16275.id45413.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
D16275.id45413.diff
View Options
Index: head/Mk/Uses/lua.mk
===================================================================
--- head/Mk/Uses/lua.mk
+++ head/Mk/Uses/lua.mk
@@ -24,7 +24,15 @@
#
.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 @@
.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 @@
.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
#
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 19, 9:24 AM (13 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16717958
Default Alt Text
D16275.id45413.diff (1 KB)
Attached To
Mode
D16275: Fix logic errors in lua.mk
Attached
Detach File
Event Timeline
Log In to Comment