diff options
-rw-r--r-- | .codecov.yml | 6 | ||||
-rw-r--r-- | .travis.yml | 6 | ||||
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | install.bat | 2 | ||||
-rw-r--r-- | spec/make_spec.lua | 5 | ||||
-rw-r--r-- | spec/upload_spec.lua | 11 | ||||
-rw-r--r-- | src/luarocks/cmd/make.lua | 3 | ||||
-rw-r--r-- | src/luarocks/repos.lua | 22 | ||||
-rw-r--r-- | test/test_environment.lua | 6 |
9 files changed, 53 insertions, 16 deletions
diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..f3b71395 --- /dev/null +++ b/.codecov.yml | |||
@@ -0,0 +1,6 @@ | |||
1 | coverage: | ||
2 | notify: | ||
3 | gitter: | ||
4 | default: | ||
5 | url: "https://webhooks.gitter.im/e/c8ee7e8a380f711aea39" | ||
6 | threshold: 1% | ||
diff --git a/.travis.yml b/.travis.yml index e651cb98..852f9b46 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -63,3 +63,9 @@ notifications: | |||
63 | email: | 63 | email: |
64 | on_success: change | 64 | on_success: change |
65 | on_failure: change | 65 | on_failure: change |
66 | webhooks: | ||
67 | urls: | ||
68 | - https://webhooks.gitter.im/e/3320fc3f28abbb06e1d8 | ||
69 | on_success: change | ||
70 | on_failure: always | ||
71 | on_start: never | ||
@@ -1,11 +1,11 @@ | |||
1 | <p align="center"><a href="http://luarocks.org"><img border="0" src="http://keplerproject.github.io/luarocks/luarocks.png" alt="LuaRocks" width="500px"></a></p> | 1 | <p align="center"><a href="http://luarocks.org"><img border="0" src="http://luarocks.github.io/luarocks/luarocks.png" alt="LuaRocks" width="500px"></a></p> |
2 | 2 | ||
3 | A package manager for Lua modules. | 3 | A package manager for Lua modules. |
4 | 4 | ||
5 | [](https://travis-ci.org/keplerproject/luarocks) | 5 | [](https://travis-ci.org/luarocks/luarocks) |
6 | [](https://ci.appveyor.com/project/hishamhm/luarocks/branch/master) | 6 | [](https://ci.appveyor.com/project/hishamhm/luarocks/branch/master) |
7 | [](https://codecov.io/gh/keplerproject/luarocks/branch/master) | 7 | [](https://codecov.io/gh/luarocks/luarocks/branch/master) |
8 | [](https://gitter.im/keplerproject/luarocks?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | 8 | [](https://gitter.im/luarocks/luarocks) |
9 | 9 | ||
10 | Main website: [luarocks.org](http://www.luarocks.org) | 10 | Main website: [luarocks.org](http://www.luarocks.org) |
11 | 11 | ||
diff --git a/install.bat b/install.bat index ddbc39c2..118abfc7 100644 --- a/install.bat +++ b/install.bat | |||
@@ -459,7 +459,7 @@ local function get_windows_sdk_directory() | |||
459 | assert(type(vars.LUA_RUNTIME) == "string", "requires vars.LUA_RUNTIME to be set before calling this function.") | 459 | assert(type(vars.LUA_RUNTIME) == "string", "requires vars.LUA_RUNTIME to be set before calling this function.") |
460 | -- Only v7.1 and v6.1 shipped with compilers | 460 | -- Only v7.1 and v6.1 shipped with compilers |
461 | -- Other versions requires a separate installation of Visual Studio. | 461 | -- Other versions requires a separate installation of Visual Studio. |
462 | -- see https://github.com/keplerproject/luarocks/pull/443#issuecomment-152792516 | 462 | -- see https://github.com/luarocks/luarocks/pull/443#issuecomment-152792516 |
463 | local wsdks = { | 463 | local wsdks = { |
464 | ["MSVCR100"] = "v7.1", -- shipped with Visual Studio 2010 compilers. | 464 | ["MSVCR100"] = "v7.1", -- shipped with Visual Studio 2010 compilers. |
465 | ["MSVCR100D"] = "v7.1", -- shipped with Visual Studio 2010 compilers. | 465 | ["MSVCR100D"] = "v7.1", -- shipped with Visual Studio 2010 compilers. |
diff --git a/spec/make_spec.lua b/spec/make_spec.lua index 89036d26..ab2d49a3 100644 --- a/spec/make_spec.lua +++ b/spec/make_spec.lua | |||
@@ -9,6 +9,7 @@ test_env.unload_luarocks() | |||
9 | local extra_rocks = { | 9 | local extra_rocks = { |
10 | "/luasocket-3.0rc1-2.src.rock", | 10 | "/luasocket-3.0rc1-2.src.rock", |
11 | "/luasocket-3.0rc1-2.rockspec", | 11 | "/luasocket-3.0rc1-2.rockspec", |
12 | "/lpeg-0.12-1.src.rock", | ||
12 | "/lxsh-0.8.6-2.src.rock", | 13 | "/lxsh-0.8.6-2.src.rock", |
13 | "/lxsh-0.8.6-2.rockspec" | 14 | "/lxsh-0.8.6-2.rockspec" |
14 | } | 15 | } |
@@ -100,11 +101,11 @@ describe("LuaRocks make tests #blackbox #b_make", function() | |||
100 | end) | 101 | end) |
101 | 102 | ||
102 | describe("LuaRocks make upgrading rockspecs with mixed deploy types", function() | 103 | describe("LuaRocks make upgrading rockspecs with mixed deploy types", function() |
103 | setup(function() | 104 | before_each(function() |
104 | test_env.copy_dir(testing_paths.testing_dir .. "/testfiles/mixed_deploy_type", "mdt") | 105 | test_env.copy_dir(testing_paths.testing_dir .. "/testfiles/mixed_deploy_type", "mdt") |
105 | end) | 106 | end) |
106 | 107 | ||
107 | teardown(function() | 108 | after_each(function() |
108 | test_env.remove_dir("mdt") | 109 | test_env.remove_dir("mdt") |
109 | os.remove("mdt."..test_env.lib_extension) | 110 | os.remove("mdt."..test_env.lib_extension) |
110 | end) | 111 | end) |
diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua index ff39cb96..6ec8e302 100644 --- a/spec/upload_spec.lua +++ b/spec/upload_spec.lua | |||
@@ -5,8 +5,6 @@ local testing_paths = test_env.testing_paths | |||
5 | test_env.unload_luarocks() | 5 | test_env.unload_luarocks() |
6 | 6 | ||
7 | local extra_rocks = { | 7 | local extra_rocks = { |
8 | "/lua-cjson-2.1.0-1.src.rock", | ||
9 | |||
10 | -- rocks needed for mock-server | 8 | -- rocks needed for mock-server |
11 | "/copas-2.0.1-1.src.rock", | 9 | "/copas-2.0.1-1.src.rock", |
12 | "/coxpcall-1.16.0-1.src.rock", | 10 | "/coxpcall-1.16.0-1.src.rock", |
@@ -42,18 +40,17 @@ describe("LuaRocks upload tests #blackbox #b_upload", function() | |||
42 | end) | 40 | end) |
43 | 41 | ||
44 | it("LuaRocks upload api key invalid and skip-pack", function() | 42 | it("LuaRocks upload api key invalid and skip-pack", function() |
45 | assert.is_false(run.luarocks_bool("upload --api-key=\"invalid\" --skip-pack luacov-0.11.0-1.rockspec")) | 43 | assert.is_false(run.luarocks_bool("upload --api-key=\"invalid\" --skip-pack " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec")) |
46 | end) | 44 | end) |
47 | 45 | ||
48 | it("LuaRocks upload force #unix", function() | 46 | it("LuaRocks upload force #unix", function() |
49 | assert.is_true(run.luarocks_bool("install lua-cjson")) | 47 | assert.is_true(test_env.need_rock("dkjson")) |
50 | assert.is_false(run.luarocks_bool("upload --api-key=\"invalid\" --force luacov-0.11.0-1.rockspec")) | 48 | assert.is_false(run.luarocks_bool("upload --api-key=\"invalid\" --force " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec")) |
51 | assert.is_true(run.luarocks_bool("install lua-cjson")) | ||
52 | end) | 49 | end) |
53 | 50 | ||
54 | describe("LuaRocks upload tests with Xavante server #mock", function() | 51 | describe("LuaRocks upload tests with Xavante server #mock", function() |
55 | before_each(function() | 52 | before_each(function() |
56 | assert.is.truthy(test_env.need_rock("restserver-xavante")) | 53 | assert.is_true(test_env.need_rock("restserver-xavante")) |
57 | local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.testing_dir .. "/mock-server.lua &", true, test_env.env_variables) | 54 | local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.testing_dir .. "/mock-server.lua &", true, test_env.env_variables) |
58 | os.execute(final_command) | 55 | os.execute(final_command) |
59 | end) | 56 | end) |
diff --git a/src/luarocks/cmd/make.lua b/src/luarocks/cmd/make.lua index d3d02814..bfdddb37 100644 --- a/src/luarocks/cmd/make.lua +++ b/src/luarocks/cmd/make.lua | |||
@@ -31,6 +31,9 @@ This command is useful as a tool for debugging rockspecs. | |||
31 | To install rocks, you'll normally want to use the "install" and | 31 | To install rocks, you'll normally want to use the "install" and |
32 | "build" commands. See the help on those for details. | 32 | "build" commands. See the help on those for details. |
33 | 33 | ||
34 | NB: Use `luarocks install` with the `--only-deps` flag if you want to install | ||
35 | only dependencies of the rockspec (see `luarocks help install`). | ||
36 | |||
34 | --pack-binary-rock Do not install rock. Instead, produce a .rock file | 37 | --pack-binary-rock Do not install rock. Instead, produce a .rock file |
35 | with the contents of compilation in the current | 38 | with the contents of compilation in the current |
36 | directory. | 39 | directory. |
diff --git a/src/luarocks/repos.lua b/src/luarocks/repos.lua index 14c26313..1abb5628 100644 --- a/src/luarocks/repos.lua +++ b/src/luarocks/repos.lua | |||
@@ -446,4 +446,26 @@ function repos.which(name, version, item_type, item_name, repo) | |||
446 | return deploy_path | 446 | return deploy_path |
447 | end | 447 | end |
448 | 448 | ||
449 | --- Find full path to a file providing a module or a command | ||
450 | -- in a package. | ||
451 | -- @param name string: name of package. | ||
452 | -- @param version string: exact package version in string format. | ||
453 | -- @param item_type string: "module" or "command". | ||
454 | -- @param item_name string: module or command name. | ||
455 | -- @param root string or nil: A local root dir for a rocks tree. If not given, the default is used. | ||
456 | -- @return string: absolute path to the file providing given module | ||
457 | -- or command. | ||
458 | function repos.which(name, version, item_type, item_name, repo) | ||
459 | local deploy_type, file_path = manif.get_providing_file(name, version, item_type, item_name, repo) | ||
460 | local non_versioned, versioned = get_deploy_paths(name, version, deploy_type, file_path, repo) | ||
461 | local cur_name, cur_version = manif.get_current_provider(item_type, item_name) | ||
462 | local deploy_path = (name == cur_name and version == cur_version) and non_versioned or versioned | ||
463 | |||
464 | if deploy_type == "bin" and cfg.wrapper_suffix and cfg.wrapper_suffix ~= "" then | ||
465 | deploy_path = find_suffixed(deploy_path, cfg.wrapper_suffix) or deploy_path | ||
466 | end | ||
467 | |||
468 | return deploy_path | ||
469 | end | ||
470 | |||
449 | return repos | 471 | return repos |
diff --git a/test/test_environment.lua b/test/test_environment.lua index f60835a0..6b160140 100644 --- a/test/test_environment.lua +++ b/test/test_environment.lua | |||
@@ -285,7 +285,7 @@ end | |||
285 | -- @param save_path string: path to directory, where to download rocks/rockspecs | 285 | -- @param save_path string: path to directory, where to download rocks/rockspecs |
286 | -- @return make_manifest boolean: true if new rocks downloaded | 286 | -- @return make_manifest boolean: true if new rocks downloaded |
287 | local function download_rocks(urls, save_path) | 287 | local function download_rocks(urls, save_path) |
288 | local luarocks_repo = "https://www.luarocks.org" | 288 | local luarocks_repo = "https://luarocks.org" |
289 | local make_manifest = false | 289 | local make_manifest = false |
290 | 290 | ||
291 | for _, url in ipairs(urls) do | 291 | for _, url in ipairs(urls) do |
@@ -533,7 +533,9 @@ function test_env.setup_specs(extra_rocks) | |||
533 | end | 533 | end |
534 | end | 534 | end |
535 | 535 | ||
536 | --- Test if required rock is installed if not, install it | 536 | --- Test if required rock is installed and if not, install it. |
537 | -- Return `true` if the rock is already installed or has been installed successfully, | ||
538 | -- `false` if installation failed. | ||
537 | function test_env.need_rock(rock) | 539 | function test_env.need_rock(rock) |
538 | print("Check if " .. rock .. " is installed") | 540 | print("Check if " .. rock .. " is installed") |
539 | if test_env.run.luarocks_noprint_nocov(test_env.quiet("show " .. rock)) then | 541 | if test_env.run.luarocks_noprint_nocov(test_env.quiet("show " .. rock)) then |