diff options
author | Hisham <hisham@gobolinux.org> | 2016-10-27 14:31:45 -0200 |
---|---|---|
committer | Hisham <hisham@gobolinux.org> | 2016-10-27 14:31:45 -0200 |
commit | 5137884ef5ec78d1922a85691eefea48d6391c76 (patch) | |
tree | 76a4d741ef85cfa4a07a5b2ef096410236a24847 | |
parent | 518e3b4f49f95a345d5f93600c85ce61b0f9fc41 (diff) | |
parent | f7ae6213f430798ec86883f9ab9917b156e1758d (diff) | |
download | luarocks-5137884ef5ec78d1922a85691eefea48d6391c76.tar.gz luarocks-5137884ef5ec78d1922a85691eefea48d6391c76.tar.bz2 luarocks-5137884ef5ec78d1922a85691eefea48d6391c76.zip |
Merge branch 'master' into luarocks-3
-rwxr-xr-x | configure | 89 | ||||
-rw-r--r-- | spec/remove_spec.lua | 9 | ||||
-rw-r--r-- | spec/show_spec.lua | 5 | ||||
-rw-r--r-- | src/luarocks/build.lua | 2 | ||||
-rw-r--r-- | src/luarocks/build/builtin.lua | 2 | ||||
-rw-r--r-- | src/luarocks/command_line.lua | 1 | ||||
-rw-r--r-- | src/luarocks/core/cfg.lua | 89 | ||||
-rw-r--r-- | src/luarocks/doc.lua | 2 | ||||
-rw-r--r-- | src/luarocks/download.lua | 2 | ||||
-rw-r--r-- | src/luarocks/lint.lua | 2 | ||||
-rw-r--r-- | src/luarocks/manif.lua | 1 | ||||
-rw-r--r-- | src/luarocks/new_version.lua | 2 | ||||
-rw-r--r-- | src/luarocks/pack.lua | 2 | ||||
-rw-r--r-- | src/luarocks/path_cmd.lua | 4 | ||||
-rw-r--r-- | src/luarocks/remove.lua | 2 | ||||
-rw-r--r-- | src/luarocks/show.lua | 2 | ||||
-rw-r--r-- | src/luarocks/unpack.lua | 2 |
17 files changed, 136 insertions, 82 deletions
@@ -229,15 +229,17 @@ detect_lua_version() { | |||
229 | detected_lua=`$1 -e 'print(_VERSION:match(" (5%.[123])$"))' 2> /dev/null` | 229 | detected_lua=`$1 -e 'print(_VERSION:match(" (5%.[123])$"))' 2> /dev/null` |
230 | if [ "$detected_lua" != "nil" ] | 230 | if [ "$detected_lua" != "nil" ] |
231 | then | 231 | then |
232 | echo "Lua version detected: $detected_lua" | ||
233 | if [ "$LUA_VERSION_SET" != "yes" ] | 232 | if [ "$LUA_VERSION_SET" != "yes" ] |
234 | then | 233 | then |
234 | echo "Lua version detected: $detected_lua" | ||
235 | LUA_VERSION=$detected_lua | 235 | LUA_VERSION=$detected_lua |
236 | elif [ "$LUA_VERSION" != "$detected_lua" ] | 236 | return 0 |
237 | elif [ "$LUA_VERSION" = "$detected_lua" ] | ||
237 | then | 238 | then |
238 | die "This clashes with the value of --lua-version. Please check your configuration." | 239 | return 0 |
239 | fi | 240 | fi |
240 | fi | 241 | fi |
242 | return 1 | ||
241 | } | 243 | } |
242 | 244 | ||
243 | search_interpreter() { | 245 | search_interpreter() { |
@@ -247,23 +249,35 @@ search_interpreter() { | |||
247 | find_lua="$LUA_BINDIR" | 249 | find_lua="$LUA_BINDIR" |
248 | elif [ "$LUA_DIR_SET" = "yes" ] | 250 | elif [ "$LUA_DIR_SET" = "yes" ] |
249 | then | 251 | then |
250 | if [ -f "$LUA_DIR/bin/lua$suffix" ] | 252 | LUA_BINDIR="$LUA_DIR/bin" |
253 | if [ -f "$LUA_BINDIR/lua$suffix" ] | ||
251 | then | 254 | then |
252 | find_lua="$LUA_DIR/bin" | 255 | find_lua="$LUA_BINDIR" |
253 | fi | 256 | fi |
254 | else | 257 | else |
255 | find_lua=`find_program lua$suffix` | 258 | find_lua=`find_program lua$suffix` |
256 | fi | 259 | fi |
257 | if [ -n "$find_lua" -a -x "$find_lua/lua$suffix" ] | 260 | if [ -n "$find_lua" -a -x "$find_lua/lua$suffix" ] |
258 | then | 261 | then |
259 | echo "Lua interpreter found: $find_lua/lua$suffix..." | 262 | if detect_lua_version "$find_lua/lua$suffix" |
260 | LUA_SUFFIX=$suffix | 263 | then |
261 | detect_lua_version "$find_lua/lua$LUA_SUFFIX" | 264 | echo "Lua interpreter found: $find_lua/lua$suffix..." |
262 | return 0 | 265 | if [ "$LUA_BINDIR_SET" != "yes" ] |
266 | then | ||
267 | LUA_BINDIR="$find_lua" | ||
268 | fi | ||
269 | if [ "$LUA_DIR_SET" != "yes" ] | ||
270 | then | ||
271 | LUA_DIR=`dirname "$find_lua"` | ||
272 | fi | ||
273 | LUA_SUFFIX="$suffix" | ||
274 | return 0 | ||
275 | fi | ||
263 | fi | 276 | fi |
264 | return 1 | 277 | return 1 |
265 | } | 278 | } |
266 | 279 | ||
280 | lua_interp_found=no | ||
267 | if [ "$LUA_SUFFIX_SET" != "yes" ] | 281 | if [ "$LUA_SUFFIX_SET" != "yes" ] |
268 | then | 282 | then |
269 | if [ "$LUA_VERSION_SET" = "yes" -a "$LUA_VERSION" = "5.1" ] | 283 | if [ "$LUA_VERSION_SET" = "yes" -a "$LUA_VERSION" = "5.1" ] |
@@ -278,7 +292,6 @@ then | |||
278 | else | 292 | else |
279 | suffixes="5.3 53 -5.3 -53 5.2 52 -5.2 -52 5.1 51 -5.1 -51" | 293 | suffixes="5.3 53 -5.3 -53 5.2 52 -5.2 -52 5.1 51 -5.1 -51" |
280 | fi | 294 | fi |
281 | lua_interp_found=no | ||
282 | for suffix in "" `echo $suffixes` | 295 | for suffix in "" `echo $suffixes` |
283 | do | 296 | do |
284 | search_interpreter "$suffix" && { | 297 | search_interpreter "$suffix" && { |
@@ -286,23 +299,28 @@ then | |||
286 | break | 299 | break |
287 | } | 300 | } |
288 | done | 301 | done |
302 | else | ||
303 | search_interpreter "$LUA_SUFFIX" && { | ||
304 | lua_interp_found=yes | ||
305 | } | ||
289 | fi | 306 | fi |
290 | 307 | ||
291 | if [ "$LUA_DIR_SET" != "yes" ] | 308 | if [ "$lua_interp_found" != "yes" ] |
292 | then | 309 | then |
293 | if [ -z "$find_lua" ] | 310 | [ "$LUA_VERSION_SET" ] && { interp="Lua $LUA_VERSION" ;} || { interp="Lua" ;} |
294 | then | 311 | [ "$LUA_DIR_SET" -o "$LUA_BINDIR_SET" ] && { where="$LUA_BINDIR" ;} || { interp="\$PATH" ;} |
295 | echo_n "Looking for Lua... " | 312 | echo "$interp interpreter not found in $where" |
296 | find_lua=`find_program lua$LUA_SUFFIX` | 313 | die "You may want to use the flags --with-lua, --with-lua-bin and/or --lua-suffix. See --help." |
297 | fi | 314 | fi |
298 | 315 | ||
299 | if [ -n "$find_lua" ] | 316 | if [ "$LUA_VERSION_SET" = "yes" ] |
317 | then | ||
318 | echo_n "Checking if $LUA_BINDIR/lua$LUA_SUFFIX is Lua version $LUA_VERSION... " | ||
319 | if detect_lua_version "$LUA_BINDIR/lua$LUA_SUFFIX" | ||
300 | then | 320 | then |
301 | LUA_DIR=`dirname $find_lua` | 321 | echo "yes" |
302 | LUA_BINDIR="$find_lua" | ||
303 | echo "lua$LUA_SUFFIX found in \$PATH: $find_lua" | ||
304 | else | 322 | else |
305 | echo "lua$LUA_SUFFIX not found in \$PATH." | 323 | echo "no" |
306 | die "You may want to use the flags --with-lua, --with-lua-bin and/or --lua-suffix. See --help." | 324 | die "You may want to use the flags --with-lua, --with-lua-bin and/or --lua-suffix. See --help." |
307 | fi | 325 | fi |
308 | fi | 326 | fi |
@@ -317,23 +335,6 @@ then | |||
317 | LUA_LIBDIR="$LUA_DIR/lib" | 335 | LUA_LIBDIR="$LUA_DIR/lib" |
318 | fi | 336 | fi |
319 | 337 | ||
320 | if [ "$LUA_DIR_SET" = "yes" -a "$LUA_BINDIR_SET" != "yes" ] | ||
321 | then | ||
322 | LUA_BINDIR="$LUA_DIR/bin" | ||
323 | fi | ||
324 | |||
325 | if [ "$lua_interp_found" != "yes" ] | ||
326 | then | ||
327 | echo_n "Checking Lua interpreter... " | ||
328 | if [ -x "$LUA_BINDIR/lua$LUA_SUFFIX" ] | ||
329 | then | ||
330 | echo "lua$LUA_SUFFIX found in $LUA_BINDIR" | ||
331 | else | ||
332 | echo "lua$LUA_SUFFIX not found (looked in $LUA_BINDIR)" | ||
333 | die "You may want to use the flag --with-lua or --with-lua-bin. See --help." | ||
334 | fi | ||
335 | fi | ||
336 | |||
337 | echo_n "Checking Lua includes... " | 338 | echo_n "Checking Lua includes... " |
338 | lua_h="$LUA_INCDIR/lua.h" | 339 | lua_h="$LUA_INCDIR/lua.h" |
339 | if [ -f "$lua_h" ] | 340 | if [ -f "$lua_h" ] |
@@ -360,6 +361,18 @@ else | |||
360 | fi | 361 | fi |
361 | fi | 362 | fi |
362 | 363 | ||
364 | echo_n "Checking if Lua header version matches that of the interpreter... " | ||
365 | header_version=$(sed -n 's/.*LUA_VERSION_NUM.*5.\(.\).*/5.\1/p' "$lua_h") | ||
366 | if [ "$header_version" = "$LUA_VERSION" ] | ||
367 | then | ||
368 | echo "yes" | ||
369 | else | ||
370 | echo "no" | ||
371 | echo "lua.h version mismatch (interpreter: $LUA_VERSION; lua.h: $header_version)." | ||
372 | die "You may want to use the flag --with-lua or --with-lua-include. See --help." | ||
373 | fi | ||
374 | |||
375 | |||
363 | if [ "$LUAROCKS_DOWNLOADER_SET" != "yes" ] | 376 | if [ "$LUAROCKS_DOWNLOADER_SET" != "yes" ] |
364 | then | 377 | then |
365 | find_helper "a downloader helper program" curl wget fetch | 378 | find_helper "a downloader helper program" curl wget fetch |
diff --git a/spec/remove_spec.lua b/spec/remove_spec.lua index 3d321e30..03b3681e 100644 --- a/spec/remove_spec.lua +++ b/spec/remove_spec.lua | |||
@@ -35,12 +35,19 @@ describe("LuaRocks remove tests #blackbox #b_remove", function() | |||
35 | assert.is_false(run.luarocks_bool("remove luacov --deps-mode")) | 35 | assert.is_false(run.luarocks_bool("remove luacov --deps-mode")) |
36 | end) | 36 | end) |
37 | 37 | ||
38 | it("LuaRocks remove builded abelhas", function() | 38 | it("LuaRocks remove built abelhas", function() |
39 | assert.is_true(run.luarocks_bool("build abelhas 1.0")) | 39 | assert.is_true(run.luarocks_bool("build abelhas 1.0")) |
40 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/abelhas")) | 40 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/abelhas")) |
41 | assert.is_true(run.luarocks_bool("remove abelhas 1.0")) | 41 | assert.is_true(run.luarocks_bool("remove abelhas 1.0")) |
42 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/abelhas")) | 42 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/abelhas")) |
43 | end) | 43 | end) |
44 | |||
45 | it("LuaRocks remove built abelhas with uppercase name", function() | ||
46 | assert.is_true(run.luarocks_bool("build abelhas 1.0")) | ||
47 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/abelhas")) | ||
48 | assert.is_true(run.luarocks_bool("remove Abelhas 1.0")) | ||
49 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/abelhas")) | ||
50 | end) | ||
44 | end) | 51 | end) |
45 | 52 | ||
46 | describe("LuaRocks remove more complex tests", function() | 53 | describe("LuaRocks remove more complex tests", function() |
diff --git a/spec/show_spec.lua b/spec/show_spec.lua index b95ea818..0b046de0 100644 --- a/spec/show_spec.lua +++ b/spec/show_spec.lua | |||
@@ -22,6 +22,11 @@ describe("LuaRocks show tests #blackbox #b_show", function() | |||
22 | local output = run.luarocks("show luacov") | 22 | local output = run.luarocks("show luacov") |
23 | assert.is.truthy(output:match("LuaCov")) | 23 | assert.is.truthy(output:match("LuaCov")) |
24 | end) | 24 | end) |
25 | |||
26 | it("LuaRocks show luacov with uppercase name", function() | ||
27 | local output = run.luarocks("show LuaCov") | ||
28 | assert.is.truthy(output:match("LuaCov")) | ||
29 | end) | ||
25 | 30 | ||
26 | it("LuaRocks show modules of luacov", function() | 31 | it("LuaRocks show modules of luacov", function() |
27 | local output = run.luarocks("show --modules luacov") | 32 | local output = run.luarocks("show --modules luacov") |
diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua index 3601dc9b..f3b054d2 100644 --- a/src/luarocks/build.lua +++ b/src/luarocks/build.lua | |||
@@ -226,7 +226,7 @@ function build.build_rockspec(rockspec_file, need_to_fetch, minimal_mode, deps_m | |||
226 | end | 226 | end |
227 | 227 | ||
228 | if not minimal_mode then | 228 | if not minimal_mode then |
229 | local _, source_dir | 229 | local source_dir |
230 | if need_to_fetch then | 230 | if need_to_fetch then |
231 | ok, source_dir, errcode = fetch.fetch_sources(rockspec, true) | 231 | ok, source_dir, errcode = fetch.fetch_sources(rockspec, true) |
232 | if not ok then | 232 | if not ok then |
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index 3a4beb17..db6f8bc4 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua | |||
@@ -175,7 +175,7 @@ function builtin.run(rockspec) | |||
175 | add_flags(extras, "-Wl,-rpath,%s:", libdirs) | 175 | add_flags(extras, "-Wl,-rpath,%s:", libdirs) |
176 | end | 176 | end |
177 | add_flags(extras, "-l%s", libraries) | 177 | add_flags(extras, "-l%s", libraries) |
178 | if cfg.is_platform("cygwin") then | 178 | if cfg.link_lua_explicitly then |
179 | add_flags(extras, "-l%s", {"lua"}) | 179 | add_flags(extras, "-l%s", {"lua"}) |
180 | end | 180 | end |
181 | return execute(variables.LD.." "..variables.LIBFLAG, "-o", library, "-L"..variables.LUA_LIBDIR, unpack(extras)) | 181 | return execute(variables.LD.." "..variables.LIBFLAG, "-o", library, "-L"..variables.LUA_LIBDIR, unpack(extras)) |
diff --git a/src/luarocks/command_line.lua b/src/luarocks/command_line.lua index f7f6ccb6..96891b75 100644 --- a/src/luarocks/command_line.lua +++ b/src/luarocks/command_line.lua | |||
@@ -2,7 +2,6 @@ | |||
2 | --- Functions for command-line scripts. | 2 | --- Functions for command-line scripts. |
3 | local command_line = {} | 3 | local command_line = {} |
4 | 4 | ||
5 | local pack = function(...) return {...}, select("#", ...) end | ||
6 | local unpack = unpack or table.unpack | 5 | local unpack = unpack or table.unpack |
7 | 6 | ||
8 | local util = require("luarocks.util") | 7 | local util = require("luarocks.util") |
diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index 17f76d14..de8b9281 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua | |||
@@ -131,24 +131,27 @@ else | |||
131 | -- Fall back to Unix in unknown systems. | 131 | -- Fall back to Unix in unknown systems. |
132 | end | 132 | end |
133 | 133 | ||
134 | -- Set order for platform overrides | 134 | -- Set order for platform overrides. |
135 | -- More general platform identifiers should be listed first, | ||
136 | -- more specific ones later. | ||
135 | local platform_order = { | 137 | local platform_order = { |
136 | -- Unixes | 138 | -- Unixes |
137 | unix = 1, | 139 | "unix", |
138 | bsd = 2, | 140 | "bsd", |
139 | solaris = 3, | 141 | "solaris", |
140 | netbsd = 4, | 142 | "netbsd", |
141 | openbsd = 5, | 143 | "openbsd", |
142 | freebsd = 6, | 144 | "freebsd", |
143 | linux = 7, | 145 | "linux", |
144 | macosx = 8, | 146 | "macosx", |
145 | cygwin = 9, | 147 | "cygwin", |
146 | msys = 10, | 148 | "msys", |
147 | haiku = 11, | 149 | "haiku", |
148 | -- Windows | 150 | -- Windows |
149 | win32 = 12, | 151 | "win32", |
150 | mingw32 = 13, | 152 | "mingw32", |
151 | windows = 14 } | 153 | "windows", |
154 | } | ||
152 | 155 | ||
153 | -- Path configuration: | 156 | -- Path configuration: |
154 | local sys_config_file, home_config_file | 157 | local sys_config_file, home_config_file |
@@ -274,26 +277,50 @@ if not next(cfg.rocks_trees) then | |||
274 | end | 277 | end |
275 | end | 278 | end |
276 | 279 | ||
277 | |||
278 | -- update platforms list; keyed -> array | 280 | -- update platforms list; keyed -> array |
279 | do | 281 | do |
280 | local lst = {} -- use temp array to not confuse `pairs` in loop | 282 | -- if explicitly given by user, |
281 | for plat in pairs(cfg.platforms) do | 283 | if cfg.platforms[1] then |
282 | if cfg.platforms[plat] then -- entries set to 'false' skipped | 284 | local is_windows = cfg.platforms.windows |
283 | if not platform_order[plat] then | 285 | -- Clear auto-detected values |
284 | local pl = "" | 286 | for k, _ in pairs(cfg.platforms) do |
285 | for k,_ in pairs(platform_order) do pl = pl .. ", " .. k end | 287 | if type(k) == "string" then |
286 | io.stderr:write("Bad platform given; "..tostring(plat)..". Valid entries are: "..pl:sub(3,-1) ..".\n") | 288 | cfg.platforms[k] = nil |
287 | os.exit(cfg.errorcodes.CONFIGFILE) | 289 | end |
290 | end | ||
291 | -- and set the ones given by the user. | ||
292 | for _, plat in ipairs(cfg.platforms) do | ||
293 | cfg.platforms[plat] = true | ||
294 | end | ||
295 | -- If no major platform family was set by the user, | ||
296 | if not (cfg.platforms.unix or cfg.platforms.windows) then | ||
297 | -- set some fallback defaults in case the user provides an incomplete configuration. | ||
298 | -- LuaRocks expects a set of defaults to be available. | ||
299 | -- This is used for setting defaults here only; the platform overrides | ||
300 | -- will use only the user's list. | ||
301 | if is_windows then | ||
302 | cfg.platforms.windows = true | ||
303 | table.insert(cfg.platforms, "windows") | ||
304 | else | ||
305 | cfg.platforms.unix = true | ||
306 | table.insert(cfg.platforms, "unix") | ||
307 | end | ||
308 | end | ||
309 | else | ||
310 | -- Sort detected platform defaults | ||
311 | local order = {} | ||
312 | for i, v in ipairs(platform_order) do | ||
313 | order[v] = i | ||
314 | end | ||
315 | local entries = {} | ||
316 | for k, v in pairs(cfg.platforms) do | ||
317 | if type(k) == "string" and v == true then | ||
318 | table.insert(entries, k) | ||
288 | end | 319 | end |
289 | table.insert(lst, plat) | ||
290 | else | ||
291 | cfg.platforms[plat] = nil | ||
292 | end | 320 | end |
321 | table.sort(entries, function(a, b) return order[a] < order[b] end) | ||
322 | util.deep_merge(cfg.platforms, entries) | ||
293 | end | 323 | end |
294 | -- platform overrides depent on the order, so set priorities | ||
295 | table.sort(lst, function(key1, key2) return platform_order[key1] < platform_order[key2] end) | ||
296 | util.deep_merge(cfg.platforms, lst) | ||
297 | end | 324 | end |
298 | 325 | ||
299 | -- Configure defaults: | 326 | -- Configure defaults: |
@@ -315,6 +342,7 @@ local defaults = { | |||
315 | arch = "unknown", | 342 | arch = "unknown", |
316 | lib_extension = "unknown", | 343 | lib_extension = "unknown", |
317 | obj_extension = "unknown", | 344 | obj_extension = "unknown", |
345 | link_lua_explicitly = false, | ||
318 | 346 | ||
319 | rocks_servers = { | 347 | rocks_servers = { |
320 | { | 348 | { |
@@ -536,6 +564,7 @@ if cfg.platforms.cygwin then | |||
536 | defaults.variables.CC = "echo -llua | xargs gcc" | 564 | defaults.variables.CC = "echo -llua | xargs gcc" |
537 | defaults.variables.LD = "echo -llua | xargs gcc" | 565 | defaults.variables.LD = "echo -llua | xargs gcc" |
538 | defaults.variables.LIBFLAG = "-shared" | 566 | defaults.variables.LIBFLAG = "-shared" |
567 | defaults.link_lua_explicitly = true | ||
539 | end | 568 | end |
540 | 569 | ||
541 | if cfg.platforms.msys then | 570 | if cfg.platforms.msys then |
diff --git a/src/luarocks/doc.lua b/src/luarocks/doc.lua index 63c4c4e3..5d521276 100644 --- a/src/luarocks/doc.lua +++ b/src/luarocks/doc.lua | |||
@@ -61,6 +61,8 @@ function doc.command(flags, name, version) | |||
61 | return nil, "Argument missing. "..util.see_help("doc") | 61 | return nil, "Argument missing. "..util.see_help("doc") |
62 | end | 62 | end |
63 | 63 | ||
64 | name = name:lower() | ||
65 | |||
64 | local iname, iversion, repo = search.pick_installed_rock(name, version, flags["tree"]) | 66 | local iname, iversion, repo = search.pick_installed_rock(name, version, flags["tree"]) |
65 | if not iname then | 67 | if not iname then |
66 | util.printout(name..(version and " "..version or "").." is not installed. Looking for it in the rocks servers...") | 68 | util.printout(name..(version and " "..version or "").." is not installed. Looking for it in the rocks servers...") |
diff --git a/src/luarocks/download.lua b/src/luarocks/download.lua index c81958de..557d1b65 100644 --- a/src/luarocks/download.lua +++ b/src/luarocks/download.lua | |||
@@ -100,7 +100,7 @@ function download.command(flags, name, version) | |||
100 | arch = flags["arch"] | 100 | arch = flags["arch"] |
101 | end | 101 | end |
102 | 102 | ||
103 | local dl, err = download.download(arch, name, version, flags["all"]) | 103 | local dl, err = download.download(arch, name:lower(), version, flags["all"]) |
104 | return dl and true, err | 104 | return dl and true, err |
105 | end | 105 | end |
106 | 106 | ||
diff --git a/src/luarocks/lint.lua b/src/luarocks/lint.lua index 742f1736..c9ea45ea 100644 --- a/src/luarocks/lint.lua +++ b/src/luarocks/lint.lua | |||
@@ -24,7 +24,7 @@ function lint.command(flags, input) | |||
24 | local filename = input | 24 | local filename = input |
25 | if not input:match(".rockspec$") then | 25 | if not input:match(".rockspec$") then |
26 | local err | 26 | local err |
27 | filename, err = download.download("rockspec", input) | 27 | filename, err = download.download("rockspec", input:lower()) |
28 | if not filename then | 28 | if not filename then |
29 | return nil, err | 29 | return nil, err |
30 | end | 30 | end |
diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua index 40657fdf..8277b3a5 100644 --- a/src/luarocks/manif.lua +++ b/src/luarocks/manif.lua | |||
@@ -32,6 +32,7 @@ function manif.load_rock_manifest(name, version, root) | |||
32 | return rock_manifest.rock_manifest | 32 | return rock_manifest.rock_manifest |
33 | end | 33 | end |
34 | 34 | ||
35 | |||
35 | local function fetch_manifest_from(repo_url, filename) | 36 | local function fetch_manifest_from(repo_url, filename) |
36 | local url = dir.path(repo_url, filename) | 37 | local url = dir.path(repo_url, filename) |
37 | local name = repo_url:gsub("[/:]","_") | 38 | local name = repo_url:gsub("[/:]","_") |
diff --git a/src/luarocks/new_version.lua b/src/luarocks/new_version.lua index 000b459b..b13dbb97 100644 --- a/src/luarocks/new_version.lua +++ b/src/luarocks/new_version.lua | |||
@@ -140,7 +140,7 @@ function new_version.command(flags, input, version, url) | |||
140 | return nil, err | 140 | return nil, err |
141 | end | 141 | end |
142 | else | 142 | else |
143 | filename, err = download.download("rockspec", input) | 143 | filename, err = download.download("rockspec", input:lower()) |
144 | if not filename then | 144 | if not filename then |
145 | return nil, err | 145 | return nil, err |
146 | end | 146 | end |
diff --git a/src/luarocks/pack.lua b/src/luarocks/pack.lua index 49c68e85..655cbf37 100644 --- a/src/luarocks/pack.lua +++ b/src/luarocks/pack.lua | |||
@@ -180,7 +180,7 @@ function pack.command(flags, arg, version) | |||
180 | if arg:match(".*%.rockspec") then | 180 | if arg:match(".*%.rockspec") then |
181 | file, err = pack.pack_source_rock(arg) | 181 | file, err = pack.pack_source_rock(arg) |
182 | else | 182 | else |
183 | file, err = do_pack_binary_rock(arg, version, flags["tree"]) | 183 | file, err = do_pack_binary_rock(arg:lower(), version, flags["tree"]) |
184 | end | 184 | end |
185 | if err then | 185 | if err then |
186 | return nil, err | 186 | return nil, err |
diff --git a/src/luarocks/path_cmd.lua b/src/luarocks/path_cmd.lua index 1f5bb07f..627d97cf 100644 --- a/src/luarocks/path_cmd.lua +++ b/src/luarocks/path_cmd.lua | |||
@@ -4,8 +4,8 @@ | |||
4 | local path_cmd = {} | 4 | local path_cmd = {} |
5 | 5 | ||
6 | local util = require("luarocks.util") | 6 | local util = require("luarocks.util") |
7 | local deps = require("luarocks.deps") | ||
8 | local cfg = require("luarocks.core.cfg") | 7 | local cfg = require("luarocks.core.cfg") |
8 | local cfg = require("luarocks.cfg") | ||
9 | 9 | ||
10 | path_cmd.help_summary = "Return the currently configured package path." | 10 | path_cmd.help_summary = "Return the currently configured package path." |
11 | path_cmd.help_arguments = "" | 11 | path_cmd.help_arguments = "" |
@@ -34,8 +34,6 @@ And on Windows: | |||
34 | --- Driver function for "path" command. | 34 | --- Driver function for "path" command. |
35 | -- @return boolean This function always succeeds. | 35 | -- @return boolean This function always succeeds. |
36 | function path_cmd.command(flags) | 36 | function path_cmd.command(flags) |
37 | local deps_mode = deps.get_deps_mode(flags) | ||
38 | |||
39 | local lr_path, lr_cpath, lr_bin = cfg.package_paths(flags["tree"]) | 37 | local lr_path, lr_cpath, lr_bin = cfg.package_paths(flags["tree"]) |
40 | local path_sep = cfg.export_path_separator | 38 | local path_sep = cfg.export_path_separator |
41 | 39 | ||
diff --git a/src/luarocks/remove.lua b/src/luarocks/remove.lua index 008d2616..e7f37604 100644 --- a/src/luarocks/remove.lua +++ b/src/luarocks/remove.lua | |||
@@ -10,7 +10,6 @@ local repos = require("luarocks.repos") | |||
10 | local path = require("luarocks.path") | 10 | local path = require("luarocks.path") |
11 | local util = require("luarocks.util") | 11 | local util = require("luarocks.util") |
12 | local cfg = require("luarocks.core.cfg") | 12 | local cfg = require("luarocks.core.cfg") |
13 | local writer = require("luarocks.manif.writer") | ||
14 | local fs = require("luarocks.fs") | 13 | local fs = require("luarocks.fs") |
15 | 14 | ||
16 | remove.help_summary = "Uninstall a rock." | 15 | remove.help_summary = "Uninstall a rock." |
@@ -154,6 +153,7 @@ function remove.command(flags, name, version) | |||
154 | end | 153 | end |
155 | 154 | ||
156 | local results = {} | 155 | local results = {} |
156 | name = name:lower() | ||
157 | search.manifest_search(results, cfg.rocks_dir, search.make_query(name, version)) | 157 | search.manifest_search(results, cfg.rocks_dir, search.make_query(name, version)) |
158 | if not results[name] then | 158 | if not results[name] then |
159 | return nil, "Could not find rock '"..name..(version and " "..version or "").."' in "..path.rocks_tree_to_string(cfg.root_dir) | 159 | return nil, "Could not find rock '"..name..(version and " "..version or "").."' in "..path.rocks_tree_to_string(cfg.root_dir) |
diff --git a/src/luarocks/show.lua b/src/luarocks/show.lua index 53d8ffa5..1ff81e08 100644 --- a/src/luarocks/show.lua +++ b/src/luarocks/show.lua | |||
@@ -76,7 +76,7 @@ function show.command(flags, name, version) | |||
76 | end | 76 | end |
77 | 77 | ||
78 | local repo, repo_url | 78 | local repo, repo_url |
79 | name, version, repo, repo_url = search.pick_installed_rock(name, version, flags["tree"]) | 79 | name, version, repo, repo_url = search.pick_installed_rock(name:lower(), version, flags["tree"]) |
80 | if not name then | 80 | if not name then |
81 | return nil, version | 81 | return nil, version |
82 | end | 82 | end |
diff --git a/src/luarocks/unpack.lua b/src/luarocks/unpack.lua index af3398ab..c50701b0 100644 --- a/src/luarocks/unpack.lua +++ b/src/luarocks/unpack.lua | |||
@@ -157,7 +157,7 @@ function unpack.command(flags, name, version) | |||
157 | return run_unpacker(name, flags["force"]) | 157 | return run_unpacker(name, flags["force"]) |
158 | else | 158 | else |
159 | local search = require("luarocks.search") | 159 | local search = require("luarocks.search") |
160 | return search.act_on_src_or_rockspec(run_unpacker, name, version) | 160 | return search.act_on_src_or_rockspec(run_unpacker, name:lower(), version) |
161 | end | 161 | end |
162 | end | 162 | end |
163 | 163 | ||