aboutsummaryrefslogtreecommitdiff
path: root/src/luarocks/download.tl
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/download.tl')
-rw-r--r--src/luarocks/download.tl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/luarocks/download.tl b/src/luarocks/download.tl
index f993da0f..9a7076f7 100644
--- a/src/luarocks/download.tl
+++ b/src/luarocks/download.tl
@@ -34,13 +34,13 @@ function download.download_all(arch: string, name: string, namespace: string, ve
34 local has_result = false 34 local has_result = false
35 local all_ok = true 35 local all_ok = true
36 local any_err = "" 36 local any_err = ""
37 for name, result in pairs(results) do -- luacheck: ignore 422 37 for rname, result in pairs(results) do -- luacheck: ignore 422
38 for version, items in pairs(result) do -- luacheck: ignore 422 38 for rversion, items in pairs(result) do -- luacheck: ignore 422
39 for _, item in ipairs(items) do 39 for _, item in ipairs(items) do
40 -- Ignore provided rocks. 40 -- Ignore provided rocks.
41 if item.arch ~= "installed" then 41 if item.arch ~= "installed" then
42 has_result = true 42 has_result = true
43 local filename = path.make_url(item.repo, name, version, item.arch) 43 local filename = path.make_url(item.repo, rname, rversion, item.arch)
44 local ok, err = get_file(filename) 44 local ok, err = get_file(filename)
45 if not ok then 45 if not ok then
46 all_ok = false 46 all_ok = false
@@ -54,11 +54,11 @@ function download.download_all(arch: string, name: string, namespace: string, ve
54 if has_result then 54 if has_result then
55 return all_ok, any_err 55 return all_ok, any_err
56 end 56 end
57 57
58 local rock = util.format_rock_name(name, namespace, version) 58 local rock = util.format_rock_name(name, namespace, version)
59 return nil, "Could not find a result named "..rock..(search_err and ": "..search_err or ".") 59 return nil, "Could not find a result named "..rock..(search_err and ": "..search_err or ".")
60end 60end
61 61
62function download.download_file(arch: string, name: string, namespace?: string, version?: string, check_lua_versions?: boolean): string, string 62function download.download_file(arch: string, name: string, namespace?: string, version?: string, check_lua_versions?: boolean): string, string
63 local query = queries.new(name, namespace, version, false, arch) 63 local query = queries.new(name, namespace, version, false, arch)
64 local search_err: string 64 local search_err: string
@@ -68,7 +68,7 @@ function download.download_file(arch: string, name: string, namespace?: string,
68 if url then 68 if url then
69 return get_file(url) 69 return get_file(url)
70 end 70 end
71 71
72 local rock = util.format_rock_name(name, namespace, version) 72 local rock = util.format_rock_name(name, namespace, version)
73 return nil, "Could not find a result named "..rock..(search_err and ": "..search_err or ".") 73 return nil, "Could not find a result named "..rock..(search_err and ": "..search_err or ".")
74end 74end