diff options
author | Hisham Muhammad <hisham@NewMachine.localdomain> | 2010-04-19 17:56:14 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@NewMachine.localdomain> | 2010-04-19 17:56:14 -0300 |
commit | 5faf8a2376e207e0e554f4f7339aad49cd2f0f5b (patch) | |
tree | 56b563d254c304fb785508c1eb1840c8d06fbb12 | |
parent | 92dd0e876a3867933f093f57f42345b243646eba (diff) | |
download | luarocks-5faf8a2376e207e0e554f4f7339aad49cd2f0f5b.tar.gz luarocks-5faf8a2376e207e0e554f4f7339aad49cd2f0f5b.tar.bz2 luarocks-5faf8a2376e207e0e554f4f7339aad49cd2f0f5b.zip |
Be case-insensitive in CLI commands. (Backport from svn)
-rw-r--r-- | src/luarocks/build.lua | 2 | ||||
-rw-r--r-- | src/luarocks/install.lua | 3 | ||||
-rw-r--r-- | src/luarocks/list.lua | 2 | ||||
-rw-r--r-- | src/luarocks/search.lua | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua index 085c7b40..62ac3808 100644 --- a/src/luarocks/build.lua +++ b/src/luarocks/build.lua | |||
@@ -280,7 +280,7 @@ function run(...) | |||
280 | return build_rock(name, true) | 280 | return build_rock(name, true) |
281 | elseif not name:match(dir.separator) then | 281 | elseif not name:match(dir.separator) then |
282 | local search = require("luarocks.search") | 282 | local search = require("luarocks.search") |
283 | return search.act_on_src_or_rockspec(run, name, version) | 283 | return search.act_on_src_or_rockspec(run, name:lower(), version) |
284 | end | 284 | end |
285 | return nil, "Don't know what to do with "..name | 285 | return nil, "Don't know what to do with "..name |
286 | end | 286 | end |
diff --git a/src/luarocks/install.lua b/src/luarocks/install.lua index 76793a3f..260c7751 100644 --- a/src/luarocks/install.lua +++ b/src/luarocks/install.lua | |||
@@ -32,6 +32,7 @@ function install_binary_rock(rock_file) | |||
32 | if not name then | 32 | if not name then |
33 | return nil, "Filename "..rock_file.." does not match format 'name-version-revision.arch.rock'." | 33 | return nil, "Filename "..rock_file.." does not match format 'name-version-revision.arch.rock'." |
34 | end | 34 | end |
35 | |||
35 | if arch ~= "all" and arch ~= cfg.arch then | 36 | if arch ~= "all" and arch ~= cfg.arch then |
36 | return nil, "Incompatible architecture "..arch, "arch" | 37 | return nil, "Incompatible architecture "..arch, "arch" |
37 | end | 38 | end |
@@ -105,7 +106,7 @@ function run(...) | |||
105 | return install_binary_rock(name) | 106 | return install_binary_rock(name) |
106 | else | 107 | else |
107 | local search = require("luarocks.search") | 108 | local search = require("luarocks.search") |
108 | local results, err = search.find_suitable_rock(search.make_query(name, version)) | 109 | local results, err = search.find_suitable_rock(search.make_query(name:lower(), version)) |
109 | if err then | 110 | if err then |
110 | return nil, err | 111 | return nil, err |
111 | elseif type(results) == "string" then | 112 | elseif type(results) == "string" then |
diff --git a/src/luarocks/list.lua b/src/luarocks/list.lua index 87c5a2ae..567ee188 100644 --- a/src/luarocks/list.lua +++ b/src/luarocks/list.lua | |||
@@ -21,7 +21,7 @@ help = [[ | |||
21 | function run(...) | 21 | function run(...) |
22 | local flags, filter, version = util.parse_flags(...) | 22 | local flags, filter, version = util.parse_flags(...) |
23 | local results = {} | 23 | local results = {} |
24 | local query = search.make_query(filter or "", version) | 24 | local query = search.make_query(filter and filter:lower() or "", version) |
25 | query.exact_name = false | 25 | query.exact_name = false |
26 | for _, tree in ipairs(cfg.rocks_trees) do | 26 | for _, tree in ipairs(cfg.rocks_trees) do |
27 | search.manifest_search(results, path.rocks_dir(tree), query) | 27 | search.manifest_search(results, path.rocks_dir(tree), query) |
diff --git a/src/luarocks/search.lua b/src/luarocks/search.lua index adbf47a8..6303eb8c 100644 --- a/src/luarocks/search.lua +++ b/src/luarocks/search.lua | |||
@@ -374,7 +374,7 @@ function run(...) | |||
374 | return nil, "Enter name and version or use --all; see help." | 374 | return nil, "Enter name and version or use --all; see help." |
375 | end | 375 | end |
376 | 376 | ||
377 | local query = make_query(name, version) | 377 | local query = make_query(name:lower(), version) |
378 | query.exact_name = false | 378 | query.exact_name = false |
379 | local results, err = search_repos(query) | 379 | local results, err = search_repos(query) |
380 | if not results then | 380 | if not results then |