diff options
author | Hisham <hisham@gobolinux.org> | 2016-02-01 09:54:46 +0100 |
---|---|---|
committer | Hisham <hisham@gobolinux.org> | 2016-02-01 09:54:46 +0100 |
commit | 79f5022066c4d801d973769fe092280e24461cc2 (patch) | |
tree | 68228aa9a7eebb0262a914a01e64bffecf2ffc8a | |
parent | 6dc745a70be16e99ca2bc3b389f92336f49b05ec (diff) | |
parent | 102a2bec7c3f54a4c323ccf3125ae85e96a54df3 (diff) | |
download | luarocks-79f5022066c4d801d973769fe092280e24461cc2.tar.gz luarocks-79f5022066c4d801d973769fe092280e24461cc2.tar.bz2 luarocks-79f5022066c4d801d973769fe092280e24461cc2.zip |
Merge branch 'master' of https://github.com/keplerproject/luarocks
-rw-r--r-- | src/luarocks/build/builtin.lua | 15 | ||||
-rw-r--r-- | src/luarocks/cache.lua | 15 | ||||
-rw-r--r-- | src/luarocks/command_line.lua | 1 | ||||
-rw-r--r-- | src/luarocks/fetch.lua | 2 | ||||
-rw-r--r-- | src/luarocks/help.lua | 2 | ||||
-rw-r--r-- | src/luarocks/make.lua | 2 | ||||
-rw-r--r-- | test/testing.bat | 2 | ||||
-rwxr-xr-x | test/testing.sh | 37 |
8 files changed, 29 insertions, 47 deletions
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index 00fd09ea..afd05954 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua | |||
@@ -174,7 +174,7 @@ function builtin.run(rockspec) | |||
174 | --TODO EXEWRAPPER | 174 | --TODO EXEWRAPPER |
175 | end | 175 | end |
176 | 176 | ||
177 | local ok = true | 177 | local ok, err |
178 | local built_modules = {} | 178 | local built_modules = {} |
179 | local luadir = path.lua_dir(rockspec.name, rockspec.version) | 179 | local luadir = path.lua_dir(rockspec.name, rockspec.version) |
180 | local libdir = path.lib_dir(rockspec.name, rockspec.version) | 180 | local libdir = path.lib_dir(rockspec.name, rockspec.version) |
@@ -202,7 +202,7 @@ function builtin.run(rockspec) | |||
202 | for name, info in pairs(build.modules) do | 202 | for name, info in pairs(build.modules) do |
203 | local moddir = path.module_to_path(name) | 203 | local moddir = path.module_to_path(name) |
204 | if type(info) == "string" then | 204 | if type(info) == "string" then |
205 | local ext = info:match(".([^.]+)$") | 205 | local ext = info:match("%.([^.]+)$") |
206 | if ext == "lua" then | 206 | if ext == "lua" then |
207 | local filename = dir.base_name(info) | 207 | local filename = dir.base_name(info) |
208 | if info:match("init%.lua$") and not name:match("%.init$") then | 208 | if info:match("init%.lua$") and not name:match("%.init$") then |
@@ -226,7 +226,7 @@ function builtin.run(rockspec) | |||
226 | if info[1] then sources = info end | 226 | if info[1] then sources = info end |
227 | if type(sources) == "string" then sources = {sources} end | 227 | if type(sources) == "string" then sources = {sources} end |
228 | for _, source in ipairs(sources) do | 228 | for _, source in ipairs(sources) do |
229 | local object = source:gsub(".[^.]*$", "."..cfg.obj_extension) | 229 | local object = source:gsub("%.[^.]*$", "."..cfg.obj_extension) |
230 | if not object then | 230 | if not object then |
231 | object = source.."."..cfg.obj_extension | 231 | object = source.."."..cfg.obj_extension |
232 | end | 232 | end |
@@ -236,11 +236,10 @@ function builtin.run(rockspec) | |||
236 | end | 236 | end |
237 | table.insert(objects, object) | 237 | table.insert(objects, object) |
238 | end | 238 | end |
239 | if not ok then break end | ||
240 | local module_name = name:match("([^.]*)$").."."..util.matchquote(cfg.lib_extension) | 239 | local module_name = name:match("([^.]*)$").."."..util.matchquote(cfg.lib_extension) |
241 | if moddir ~= "" then | 240 | if moddir ~= "" then |
242 | module_name = dir.path(moddir, module_name) | 241 | module_name = dir.path(moddir, module_name) |
243 | local ok, err = fs.make_dir(moddir) | 242 | ok, err = fs.make_dir(moddir) |
244 | if not ok then return nil, err end | 243 | if not ok then return nil, err end |
245 | end | 244 | end |
246 | built_modules[module_name] = dir.path(libdir, module_name) | 245 | built_modules[module_name] = dir.path(libdir, module_name) |
@@ -252,13 +251,13 @@ function builtin.run(rockspec) | |||
252 | end | 251 | end |
253 | for name, dest in pairs(built_modules) do | 252 | for name, dest in pairs(built_modules) do |
254 | fs.make_dir(dir.dir_name(dest)) | 253 | fs.make_dir(dir.dir_name(dest)) |
255 | ok = fs.copy(name, dest) | 254 | ok, err = fs.copy(name, dest) |
256 | if not ok then | 255 | if not ok then |
257 | return nil, "Failed installing "..name.." in "..dest | 256 | return nil, "Failed installing "..name.." in "..dest..": "..err |
258 | end | 257 | end |
259 | end | 258 | end |
260 | if fs.is_dir("lua") then | 259 | if fs.is_dir("lua") then |
261 | local ok, err = fs.copy_contents("lua", luadir) | 260 | ok, err = fs.copy_contents("lua", luadir) |
262 | if not ok then | 261 | if not ok then |
263 | return nil, "Failed copying contents of 'lua' directory: "..err | 262 | return nil, "Failed copying contents of 'lua' directory: "..err |
264 | end | 263 | end |
diff --git a/src/luarocks/cache.lua b/src/luarocks/cache.lua index dbea8405..fb6344d8 100644 --- a/src/luarocks/cache.lua +++ b/src/luarocks/cache.lua | |||
@@ -45,25 +45,12 @@ function cache.split_server_url(server, url, user, password) | |||
45 | user = credentials | 45 | user = credentials |
46 | end | 46 | end |
47 | end | 47 | end |
48 | local local_cache | 48 | local local_cache = cfg.local_cache .. "/" .. server |
49 | if cfg.local_cache then | ||
50 | local_cache = cfg.local_cache .. "/" .. server | ||
51 | end | ||
52 | return local_cache, protocol, server_path, user, password | 49 | return local_cache, protocol, server_path, user, password |
53 | end | 50 | end |
54 | 51 | ||
55 | function cache.refresh_local_cache(server, url, user, password) | 52 | function cache.refresh_local_cache(server, url, user, password) |
56 | local local_cache, protocol, server_path, user, password = cache.split_server_url(server, url, user, password) | 53 | local local_cache, protocol, server_path, user, password = cache.split_server_url(server, url, user, password) |
57 | |||
58 | local ok, err = fs.make_dir(cfg.local_cache) | ||
59 | if not ok then return nil, err end | ||
60 | |||
61 | local tmp_cache = false | ||
62 | if not local_cache then | ||
63 | local err | ||
64 | local_cache, err = fs.make_temp_dir("local_cache") | ||
65 | tmp_cache = true | ||
66 | end | ||
67 | local ok, err = fs.make_dir(local_cache) | 54 | local ok, err = fs.make_dir(local_cache) |
68 | if not ok then | 55 | if not ok then |
69 | return nil, "Failed creating local cache dir: "..err | 56 | return nil, "Failed creating local cache dir: "..err |
diff --git a/src/luarocks/command_line.lua b/src/luarocks/command_line.lua index e1c9f492..a016fc72 100644 --- a/src/luarocks/command_line.lua +++ b/src/luarocks/command_line.lua | |||
@@ -144,7 +144,6 @@ function command_line.run_command(...) | |||
144 | end | 144 | end |
145 | end | 145 | end |
146 | if not named then | 146 | if not named then |
147 | local fs = require("luarocks.fs") | ||
148 | local root_dir = fs.absolute_name(flags["tree"]) | 147 | local root_dir = fs.absolute_name(flags["tree"]) |
149 | replace_tree(flags, args, root_dir) | 148 | replace_tree(flags, args, root_dir) |
150 | end | 149 | end |
diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua index e92aeddf..2c028771 100644 --- a/src/luarocks/fetch.lua +++ b/src/luarocks/fetch.lua | |||
@@ -371,7 +371,7 @@ function fetch.fetch_sources(rockspec, extract, dest_dir) | |||
371 | local protocol = rockspec.source.protocol | 371 | local protocol = rockspec.source.protocol |
372 | local ok, proto | 372 | local ok, proto |
373 | if fetch.is_basic_protocol(protocol) then | 373 | if fetch.is_basic_protocol(protocol) then |
374 | proto = require("luarocks.fetch") | 374 | proto = fetch |
375 | else | 375 | else |
376 | ok, proto = pcall(require, "luarocks.fetch."..protocol:gsub("[+-]", "_")) | 376 | ok, proto = pcall(require, "luarocks.fetch."..protocol:gsub("[+-]", "_")) |
377 | if not ok then | 377 | if not ok then |
diff --git a/src/luarocks/help.lua b/src/luarocks/help.lua index 92458b2b..5a2681a3 100644 --- a/src/luarocks/help.lua +++ b/src/luarocks/help.lua | |||
@@ -111,7 +111,7 @@ function help.run(...) | |||
111 | print_section("SEE ALSO") | 111 | print_section("SEE ALSO") |
112 | util.printout("","'"..program.." help' for general options and configuration.\n") | 112 | util.printout("","'"..program.." help' for general options and configuration.\n") |
113 | else | 113 | else |
114 | return nil, "Unknown command '"..command.."'" | 114 | return nil, "Unknown command: "..command |
115 | end | 115 | end |
116 | end | 116 | end |
117 | return true | 117 | return true |
diff --git a/src/luarocks/make.lua b/src/luarocks/make.lua index 1dfe6473..4f70bafe 100644 --- a/src/luarocks/make.lua +++ b/src/luarocks/make.lua | |||
@@ -54,7 +54,7 @@ function make.run(...) | |||
54 | 54 | ||
55 | if not rockspec then | 55 | if not rockspec then |
56 | for file in fs.dir() do | 56 | for file in fs.dir() do |
57 | if file:match("rockspec$") then | 57 | if file:match("rockspec$") and fs.is_file(file) then |
58 | if rockspec then | 58 | if rockspec then |
59 | return nil, "Please specify which rockspec file to use." | 59 | return nil, "Please specify which rockspec file to use." |
60 | else | 60 | else |
diff --git a/test/testing.bat b/test/testing.bat index 319e12c3..7083678b 100644 --- a/test/testing.bat +++ b/test/testing.bat | |||
@@ -1,7 +1,7 @@ | |||
1 | @echo off | 1 | @echo off |
2 | Setlocal EnableDelayedExpansion EnableExtensions | 2 | Setlocal EnableDelayedExpansion EnableExtensions |
3 | 3 | ||
4 | if not defined LUAROCKS_REPO set LUAROCKS_REPO=http://rocks.moonscript.org | 4 | if not defined LUAROCKS_REPO set LUAROCKS_REPO=https://luarocks.org |
5 | 5 | ||
6 | appveyor DownloadFile %LUAROCKS_REPO%/stdlib-41.0.0-1.src.rock | 6 | appveyor DownloadFile %LUAROCKS_REPO%/stdlib-41.0.0-1.src.rock |
7 | luarocks build stdlib | 7 | luarocks build stdlib |
diff --git a/test/testing.sh b/test/testing.sh index 70bd68b2..44e78205 100755 --- a/test/testing.sh +++ b/test/testing.sh | |||
@@ -119,20 +119,15 @@ upload_servers = { | |||
119 | EOF | 119 | EOF |
120 | cat <<EOF > $testing_dir/luacov.config | 120 | cat <<EOF > $testing_dir/luacov.config |
121 | return { | 121 | return { |
122 | ["configfile"] = ".luacov", | 122 | statsfile = "$testing_dir/luacov.stats.out", |
123 | ["statsfile"] = "$testing_dir/luacov.stats.out", | 123 | reportfile = "$testing_dir/luacov.report.out", |
124 | ["reportfile"] = "$testing_dir/luacov.report.out", | 124 | modules = { |
125 | runreport = false, | 125 | ["luarocks"] = "src/bin/luarocks", |
126 | deletestats = false, | 126 | ["luarocks-admin"] = "src/bin/luarocks-admin", |
127 | ["include"] = {}, | 127 | ["luarocks.*"] = "src", |
128 | ["exclude"] = { | 128 | ["luarocks.*.*"] = "src", |
129 | "luacov$", | 129 | ["luarocks.*.*.*"] = "src" |
130 | "luacov%.reporter$", | 130 | } |
131 | "luacov%.defaults$", | ||
132 | "luacov%.runner$", | ||
133 | "luacov%.stats$", | ||
134 | "luacov%.tick$", | ||
135 | }, | ||
136 | } | 131 | } |
137 | EOF | 132 | EOF |
138 | 133 | ||
@@ -184,7 +179,7 @@ srcdir_luasocket=luasocket-3.0-rc1 | |||
184 | version_cprint=0.1 | 179 | version_cprint=0.1 |
185 | verrev_cprint=0.1-2 | 180 | verrev_cprint=0.1-2 |
186 | 181 | ||
187 | version_luacov=0.8 | 182 | version_luacov=0.9.1 |
188 | verrev_luacov=${version_luacov}-1 | 183 | verrev_luacov=${version_luacov}-1 |
189 | version_lxsh=0.8.6 | 184 | version_lxsh=0.8.6 |
190 | version_validate_args=1.5.4 | 185 | version_validate_args=1.5.4 |
@@ -230,7 +225,7 @@ luarocks_admin_nocov="run_lua --nocov luarocks-admin" | |||
230 | mkdir -p "$testing_server" | 225 | mkdir -p "$testing_server" |
231 | ( | 226 | ( |
232 | cd "$testing_server" | 227 | cd "$testing_server" |
233 | luarocks_repo="http://rocks.moonscript.org" | 228 | luarocks_repo="https://luarocks.org" |
234 | get() { [ -e `basename "$1"` ] || wget -c "$1"; } | 229 | get() { [ -e `basename "$1"` ] || wget -c "$1"; } |
235 | get "$luarocks_repo/luacov-${verrev_luacov}.src.rock" | 230 | get "$luarocks_repo/luacov-${verrev_luacov}.src.rock" |
236 | get "$luarocks_repo/luacov-${verrev_luacov}.rockspec" | 231 | get "$luarocks_repo/luacov-${verrev_luacov}.rockspec" |
@@ -591,16 +586,18 @@ run_all_tests() { | |||
591 | run_all_tests $1 | 586 | run_all_tests $1 |
592 | #run_with_minimal_environment $1 | 587 | #run_with_minimal_environment $1 |
593 | 588 | ||
589 | cd "$testing_dir/.." | ||
590 | |||
594 | if [ "$travis" ] | 591 | if [ "$travis" ] |
595 | then | 592 | then |
596 | if [ "$TRAVIS" ] | 593 | if [ "$TRAVIS" ] |
597 | then | 594 | then |
598 | build_environment luacov luafilesystem luacov-coveralls | 595 | build_environment luacov luafilesystem luacov-coveralls |
599 | ( cd $testing_dir; $testing_sys_tree/bin/luacov-coveralls || echo "ok" ) | 596 | $testing_sys_tree/bin/luacov-coveralls -c "$testing_dir/luacov.config" || echo "ok" |
600 | fi | 597 | fi |
601 | $testing_sys_tree/bin/luacov -c $testing_dir/luacov.config src/luarocks src/bin | 598 | $testing_sys_tree/bin/luacov -c "$testing_dir/luacov.config" |
602 | grep "Summary" -B1 -A1000 $testing_dir/luacov.report.out | 599 | grep "Summary" -B1 -A1000 "$testing_dir/luacov.report.out" |
603 | else | 600 | else |
604 | $testing_sys_tree/bin/luacov -c $testing_dir/luacov.config src/luarocks src/bin | 601 | $testing_sys_tree/bin/luacov -c "$testing_dir/luacov.config" |
605 | cat "$testing_dir/luacov.report.out" | 602 | cat "$testing_dir/luacov.report.out" |
606 | fi | 603 | fi |