aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure4
-rw-r--r--install.bat2
-rw-r--r--src/luarocks/cfg.lua2
3 files changed, 4 insertions, 4 deletions
diff --git a/configure b/configure
index 665d52bc..3636aed3 100755
--- a/configure
+++ b/configure
@@ -226,8 +226,8 @@ then
226fi 226fi
227 227
228detect_lua_version() { 228detect_lua_version() {
229 detected_lua=`$1 -e 'print(_VERSION:sub(5))' 2> /dev/null` 229 detected_lua=`$1 -e 'print(_VERSION:match(" (5%.[123])$"))' 2> /dev/null`
230 if [ "$detected_lua" = "5.1" -o "$detected_lua" = "5.2" -o "$detected_lua" = "5.3" ] 230 if [ "$detected_lua" != "nil" ]
231 then 231 then
232 echo "Lua version detected: $detected_lua" 232 echo "Lua version detected: $detected_lua"
233 if [ "$LUA_VERSION_SET" != "yes" ] 233 if [ "$LUA_VERSION_SET" != "yes" ]
diff --git a/install.bat b/install.bat
index cfa080e5..0a35a28a 100644
--- a/install.bat
+++ b/install.bat
@@ -262,7 +262,7 @@ local function detect_lua_version(interpreter_path)
262 local full_version = handler:read("*a") 262 local full_version = handler:read("*a")
263 handler:close() 263 handler:close()
264 264
265 local version = full_version:match("^Lua (5%.[123])$") 265 local version = full_version:match(" (5%.[123])$")
266 if not version then 266 if not version then
267 return nil, "unknown interpreter version '" .. full_version .. "'" 267 return nil, "unknown interpreter version '" .. full_version .. "'"
268 end 268 end
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index bcb30342..33176161 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -18,7 +18,7 @@ package.loaded["luarocks.cfg"] = cfg
18 18
19local util = require("luarocks.util") 19local util = require("luarocks.util")
20 20
21cfg.lua_version = _VERSION:sub(5) 21cfg.lua_version = _VERSION:match(" (5%.[123])$") or "5.1"
22local version_suffix = cfg.lua_version:gsub("%.", "_") 22local version_suffix = cfg.lua_version:gsub("%.", "_")
23 23
24-- Load site-local global configurations 24-- Load site-local global configurations