diff options
| author | Hisham <hisham@gobolinux.org> | 2016-10-15 10:16:56 -0700 |
|---|---|---|
| committer | Hisham <hisham@gobolinux.org> | 2016-10-15 10:16:56 -0700 |
| commit | bcd4344e557476e00e10796f6f82927904c23c88 (patch) | |
| tree | 51df0526ff3449c4b54aed659988d03f7ef7fb72 | |
| parent | 1c4779c2f13b1bbc74cfdbb906f6a4225867f74b (diff) | |
| parent | 90a39598f98bb203b3ddeed1c637fe4239046525 (diff) | |
| download | luarocks-bcd4344e557476e00e10796f6f82927904c23c88.tar.gz luarocks-bcd4344e557476e00e10796f6f82927904c23c88.tar.bz2 luarocks-bcd4344e557476e00e10796f6f82927904c23c88.zip | |
Merge branch 'master' of https://github.com/keplerproject/luarocks
| -rw-r--r-- | .travis.yml | 2 | ||||
| -rwxr-xr-x | configure | 4 | ||||
| -rw-r--r-- | install.bat | 2 | ||||
| -rw-r--r-- | src/luarocks/cfg.lua | 2 | ||||
| -rw-r--r-- | src/luarocks/manif.lua | 11 | ||||
| -rw-r--r-- | test/test_environment.lua | 3 |
6 files changed, 16 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index 4962f290..ff2fb661 100644 --- a/.travis.yml +++ b/.travis.yml | |||
| @@ -40,7 +40,7 @@ matrix: | |||
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | before_install: | 42 | before_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 -r^ --$LUA | 45 | - hererocks lua_install -r^ --$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 |
| @@ -226,8 +226,8 @@ then | |||
| 226 | fi | 226 | fi |
| 227 | 227 | ||
| 228 | detect_lua_version() { | 228 | detect_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 | ||
| 19 | local util = require("luarocks.util") | 19 | local util = require("luarocks.util") |
| 20 | 20 | ||
| 21 | cfg.lua_version = _VERSION:sub(5) | 21 | cfg.lua_version = _VERSION:match(" (5%.[123])$") or "5.1" |
| 22 | local version_suffix = cfg.lua_version:gsub("%.", "_") | 22 | local version_suffix = cfg.lua_version:gsub("%.", "_") |
| 23 | 23 | ||
| 24 | -- Load site-local global configurations | 24 | -- Load site-local global configurations |
diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua index e30c2a33..48b4f23d 100644 --- a/src/luarocks/manif.lua +++ b/src/luarocks/manif.lua | |||
| @@ -464,6 +464,11 @@ function manif.zip_manifests() | |||
| 464 | end | 464 | end |
| 465 | end | 465 | end |
| 466 | 466 | ||
| 467 | local function relative_path(from_dir, to_file) | ||
| 468 | -- It is assumed that `from_dir` is prefix of `to_file`. | ||
| 469 | return (to_file:sub(#from_dir + 1):gsub("^[\\/]*", "")) | ||
| 470 | end | ||
| 471 | |||
| 467 | local function find_providers(file, root) | 472 | local function find_providers(file, root) |
| 468 | assert(type(file) == "string") | 473 | assert(type(file) == "string") |
| 469 | root = root or cfg.root_dir | 474 | root = root or cfg.root_dir |
| @@ -479,13 +484,13 @@ local function find_providers(file, root) | |||
| 479 | 484 | ||
| 480 | if util.starts_with(file, deploy_lua) then | 485 | if util.starts_with(file, deploy_lua) then |
| 481 | manifest_tbl = manifest.modules | 486 | manifest_tbl = manifest.modules |
| 482 | key = path.path_to_module(file:sub(#deploy_lua+1):gsub("\\", "/")) | 487 | key = path.path_to_module(relative_path(deploy_lua, file):gsub("\\", "/")) |
| 483 | elseif util.starts_with(file, deploy_lib) then | 488 | elseif util.starts_with(file, deploy_lib) then |
| 484 | manifest_tbl = manifest.modules | 489 | manifest_tbl = manifest.modules |
| 485 | key = path.path_to_module(file:sub(#deploy_lib+1):gsub("\\", "/")) | 490 | key = path.path_to_module(relative_path(deploy_lib, file):gsub("\\", "/")) |
| 486 | elseif util.starts_with(file, deploy_bin) then | 491 | elseif util.starts_with(file, deploy_bin) then |
| 487 | manifest_tbl = manifest.commands | 492 | manifest_tbl = manifest.commands |
| 488 | key = file:sub(#deploy_bin+1):gsub("^[\\/]*", "") | 493 | key = relative_path(deploy_bin, file) |
| 489 | else | 494 | else |
| 490 | assert(false, "Assertion failed: '"..file.."' is not a deployed file.") | 495 | assert(false, "Assertion failed: '"..file.."' is not a deployed file.") |
| 491 | end | 496 | end |
diff --git a/test/test_environment.lua b/test/test_environment.lua index 8239795d..87401a90 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 |
