diff options
| author | mpeterv <mpeterval@gmail.com> | 2016-03-20 13:05:10 +0300 |
|---|---|---|
| committer | mpeterv <mpeterval@gmail.com> | 2016-04-19 00:34:31 +0300 |
| commit | 608467a030aa14919e06b2ff8cae529d0db273bd (patch) | |
| tree | e883b2d3aac1a8198b9c4f15ca001dd019eeb8fd /src | |
| parent | 09da2f695b3e531e8bc88082e9f06f3875685cab (diff) | |
| download | luarocks-608467a030aa14919e06b2ff8cae529d0db273bd.tar.gz luarocks-608467a030aa14919e06b2ff8cae529d0db273bd.tar.bz2 luarocks-608467a030aa14919e06b2ff8cae529d0db273bd.zip | |
Show search error in functions using find_suitable_rock
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/deps.lua | 2 | ||||
| -rw-r--r-- | src/luarocks/download.lua | 7 | ||||
| -rw-r--r-- | src/luarocks/search.lua | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index 278b6356..812e6d18 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua | |||
| @@ -486,7 +486,7 @@ function deps.fulfill_dependencies(rockspec, deps_mode) | |||
| 486 | if not match_dep(dep, nil, deps_mode) then | 486 | if not match_dep(dep, nil, deps_mode) then |
| 487 | local url, err = search.find_suitable_rock(dep) | 487 | local url, err = search.find_suitable_rock(dep) |
| 488 | if not url then | 488 | if not url then |
| 489 | return nil, "Could not satisfy dependency: "..deps.show_dep(dep) | 489 | return nil, "Could not satisfy dependency "..deps.show_dep(dep)..": "..err |
| 490 | end | 490 | end |
| 491 | local ok, err, errcode = install.run(url, deps.deps_mode_to_flag(deps_mode)) | 491 | local ok, err, errcode = install.run(url, deps.deps_mode_to_flag(deps_mode)) |
| 492 | if not ok then | 492 | if not ok then |
diff --git a/src/luarocks/download.lua b/src/luarocks/download.lua index f08ba7fe..090f49aa 100644 --- a/src/luarocks/download.lua +++ b/src/luarocks/download.lua | |||
| @@ -39,6 +39,7 @@ end | |||
| 39 | function download.download(arch, name, version, all) | 39 | function download.download(arch, name, version, all) |
| 40 | local query = search.make_query(name, version) | 40 | local query = search.make_query(name, version) |
| 41 | if arch then query.arch = arch end | 41 | if arch then query.arch = arch end |
| 42 | local search_err | ||
| 42 | 43 | ||
| 43 | if all then | 44 | if all then |
| 44 | if name == "" then query.exact_name = false end | 45 | if name == "" then query.exact_name = false end |
| @@ -67,12 +68,14 @@ function download.download(arch, name, version, all) | |||
| 67 | return all_ok, any_err | 68 | return all_ok, any_err |
| 68 | end | 69 | end |
| 69 | else | 70 | else |
| 70 | local url = search.find_suitable_rock(query) | 71 | local url |
| 72 | url, search_err = search.find_suitable_rock(query) | ||
| 71 | if url then | 73 | if url then |
| 72 | return get_file(url) | 74 | return get_file(url) |
| 73 | end | 75 | end |
| 74 | end | 76 | end |
| 75 | return nil, "Could not find a result named "..name..(version and " "..version or "").."." | 77 | return nil, "Could not find a result named "..name..(version and " "..version or "").. |
| 78 | (search_err and ": "..search_err or ".") | ||
| 76 | end | 79 | end |
| 77 | 80 | ||
| 78 | --- Driver function for the "download" command. | 81 | --- Driver function for the "download" command. |
diff --git a/src/luarocks/search.lua b/src/luarocks/search.lua index a06fdd45..0276dfae 100644 --- a/src/luarocks/search.lua +++ b/src/luarocks/search.lua | |||
| @@ -369,7 +369,7 @@ function search.act_on_src_or_rockspec(action, name, version, ...) | |||
| 369 | query.arch = "src|rockspec" | 369 | query.arch = "src|rockspec" |
| 370 | local url, err = search.find_suitable_rock(query) | 370 | local url, err = search.find_suitable_rock(query) |
| 371 | if not url then | 371 | if not url then |
| 372 | return nil, "Could not find a result named "..name..(version and " "..version or "").."." | 372 | return nil, "Could not find a result named "..name..(version and " "..version or "")..": "..err |
| 373 | end | 373 | end |
| 374 | return action(url, ...) | 374 | return action(url, ...) |
| 375 | end | 375 | end |
