aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham <hisham@gobolinux.org>2016-10-15 10:19:34 -0700
committerHisham <hisham@gobolinux.org>2016-10-15 10:19:34 -0700
commit6f928845e8d167cf4caf4828a79069d9b71cffd8 (patch)
tree98fabdaaf9f7ac6f6f0a5938c8b9a2d5d52a87fa
parenta47f54bb139aa3b932d807e89a0691dfdfaa9723 (diff)
parentbcd4344e557476e00e10796f6f82927904c23c88 (diff)
downloadluarocks-6f928845e8d167cf4caf4828a79069d9b71cffd8.tar.gz
luarocks-6f928845e8d167cf4caf4828a79069d9b71cffd8.tar.bz2
luarocks-6f928845e8d167cf4caf4828a79069d9b71cffd8.zip
Merge branch 'master' into luarocks-3
-rw-r--r--.travis.yml2
-rwxr-xr-xconfigure4
-rw-r--r--install.bat2
-rw-r--r--src/luarocks/core/cfg.lua2
-rw-r--r--src/luarocks/manif.lua11
-rw-r--r--test/test_environment.lua3
6 files changed, 16 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
index 4f32d3a2..e651cb98 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -40,7 +40,7 @@ matrix:
40 40
41 41
42before_install: 42before_install:
43 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew install python; fi 43 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update;fi
44 - pip install hererocks 44 - pip install hererocks
45 - hererocks lua_install --luarocks @luarocks-3 --$LUA 45 - hererocks lua_install --luarocks @luarocks-3 --$LUA
46 - export PATH=$PATH:$PWD/lua_install/bin # Add directory with all installed binaries to PATH 46 - export PATH=$PATH:$PWD/lua_install/bin # Add directory with all installed binaries to PATH
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 7c0f8b73..ddbc39c2 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/core/cfg.lua b/src/luarocks/core/cfg.lua
index b5c60ed1..17f76d14 100644
--- a/src/luarocks/core/cfg.lua
+++ b/src/luarocks/core/cfg.lua
@@ -15,7 +15,7 @@ local rawset, next, table, pairs, require, io, os, setmetatable, pcall, ipairs,
15 15
16local cfg = {} 16local cfg = {}
17 17
18cfg.lua_version = _VERSION:sub(5) 18cfg.lua_version = _VERSION:match(" (5%.[123])$") or "5.1"
19local version_suffix = cfg.lua_version:gsub("%.", "_") 19local version_suffix = cfg.lua_version:gsub("%.", "_")
20 20
21-- Load site-local global configurations 21-- Load site-local global configurations
diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua
index c4da9a8e..680b5cfe 100644
--- a/src/luarocks/manif.lua
+++ b/src/luarocks/manif.lua
@@ -107,6 +107,11 @@ function manif.load_manifest(repo_url, lua_version)
107 return manif.manifest_loader(pathname, repo_url, lua_version) 107 return manif.manifest_loader(pathname, repo_url, lua_version)
108end 108end
109 109
110local function relative_path(from_dir, to_file)
111 -- It is assumed that `from_dir` is prefix of `to_file`.
112 return (to_file:sub(#from_dir + 1):gsub("^[\\/]*", ""))
113end
114
110local function find_providers(file, root) 115local function find_providers(file, root)
111 assert(type(file) == "string") 116 assert(type(file) == "string")
112 root = root or cfg.root_dir 117 root = root or cfg.root_dir
@@ -122,13 +127,13 @@ local function find_providers(file, root)
122 127
123 if util.starts_with(file, deploy_lua) then 128 if util.starts_with(file, deploy_lua) then
124 manifest_tbl = manifest.modules 129 manifest_tbl = manifest.modules
125 key = path.path_to_module(file:sub(#deploy_lua+1):gsub("\\", "/")) 130 key = path.path_to_module(relative_path(deploy_lua, file):gsub("\\", "/"))
126 elseif util.starts_with(file, deploy_lib) then 131 elseif util.starts_with(file, deploy_lib) then
127 manifest_tbl = manifest.modules 132 manifest_tbl = manifest.modules
128 key = path.path_to_module(file:sub(#deploy_lib+1):gsub("\\", "/")) 133 key = path.path_to_module(relative_path(deploy_lib, file):gsub("\\", "/"))
129 elseif util.starts_with(file, deploy_bin) then 134 elseif util.starts_with(file, deploy_bin) then
130 manifest_tbl = manifest.commands 135 manifest_tbl = manifest.commands
131 key = file:sub(#deploy_bin+1):gsub("^[\\/]*", "") 136 key = relative_path(deploy_bin, file)
132 else 137 else
133 assert(false, "Assertion failed: '"..file.."' is not a deployed file.") 138 assert(false, "Assertion failed: '"..file.."' is not a deployed file.")
134 end 139 end
diff --git a/test/test_environment.lua b/test/test_environment.lua
index 799e13ec..f04c22b8 100644
--- a/test/test_environment.lua
+++ b/test/test_environment.lua
@@ -202,6 +202,9 @@ function test_env.set_args()
202 202
203 if execute_bool("sw_vers") then 203 if execute_bool("sw_vers") then
204 test_env.TEST_TARGET_OS = "osx" 204 test_env.TEST_TARGET_OS = "osx"
205 if test_env.TRAVIS then
206 test_env.OPENSSL_DIRS = "OPENSSL_LIBDIR=/usr/local/opt/openssl/lib OPENSSL_INCDIR=/usr/local/opt/openssl/include"
207 end
205 elseif execute_output("uname -s") == "Linux" then 208 elseif execute_output("uname -s") == "Linux" then
206 test_env.TEST_TARGET_OS = "linux" 209 test_env.TEST_TARGET_OS = "linux"
207 else 210 else