aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/list.lua4
-rw-r--r--src/luarocks/manif_core.lua12
-rw-r--r--src/luarocks/search.lua2
3 files changed, 10 insertions, 8 deletions
diff --git a/src/luarocks/list.lua b/src/luarocks/list.lua
index fddded03..99868028 100644
--- a/src/luarocks/list.lua
+++ b/src/luarocks/list.lua
@@ -93,8 +93,8 @@ function list.run(...)
93 93
94 local results = {} 94 local results = {}
95 for _, tree in ipairs(trees) do 95 for _, tree in ipairs(trees) do
96 local ok, err = search.manifest_search(results, path.rocks_dir(tree), query) 96 local ok, err, errcode = search.manifest_search(results, path.rocks_dir(tree), query)
97 if not ok then 97 if not ok and errcode ~= "open" then
98 util.warning(err) 98 util.warning(err)
99 end 99 end
100 end 100 end
diff --git a/src/luarocks/manif_core.lua b/src/luarocks/manif_core.lua
index d719caa2..87fc16cf 100644
--- a/src/luarocks/manif_core.lua
+++ b/src/luarocks/manif_core.lua
@@ -18,16 +18,18 @@ manif_core.manifest_cache = {}
18-- @param file string: The local filename of the manifest file. 18-- @param file string: The local filename of the manifest file.
19-- @param repo_url string: The repository identifier. 19-- @param repo_url string: The repository identifier.
20-- @param quick boolean: If given, skips type checking. 20-- @param quick boolean: If given, skips type checking.
21-- @return table or (nil, string, string): the manifest or nil,
22-- error message and error code ("open", "load", "run" or "type").
21function manif_core.manifest_loader(file, repo_url, quick) 23function manif_core.manifest_loader(file, repo_url, quick)
22 local manifest, err = persist.load_into_table(file) 24 local manifest, err, errcode = persist.load_into_table(file)
23 if not manifest then 25 if not manifest then
24 return nil, "Failed loading manifest for "..repo_url..": "..err 26 return nil, "Failed loading manifest for "..repo_url..": "..err, errcode
25 end 27 end
26 local globals = err 28 local globals = err
27 if not quick then 29 if not quick then
28 local ok, err = type_check.type_check_manifest(manifest, globals) 30 local ok, err = type_check.type_check_manifest(manifest, globals)
29 if not ok then 31 if not ok then
30 return nil, "Error checking manifest: "..err 32 return nil, "Error checking manifest: "..err, "type"
31 end 33 end
32 end 34 end
33 35
@@ -39,8 +41,8 @@ end
39-- All functions that use manifest tables assume they were obtained 41-- All functions that use manifest tables assume they were obtained
40-- through either this function or load_manifest. 42-- through either this function or load_manifest.
41-- @param repo_url string: URL or pathname for the repository. 43-- @param repo_url string: URL or pathname for the repository.
42-- @return table or (nil, string): A table representing the manifest, 44-- @return table or (nil, string, string): A table representing the manifest,
43-- or nil followed by an error message. 45-- or nil followed by an error message and an error code, see manifest_loader.
44function manif_core.load_local_manifest(repo_url) 46function manif_core.load_local_manifest(repo_url)
45 assert(type(repo_url) == "string") 47 assert(type(repo_url) == "string")
46 48
diff --git a/src/luarocks/search.lua b/src/luarocks/search.lua
index 5e6cf50e..a06fdd45 100644
--- a/src/luarocks/search.lua
+++ b/src/luarocks/search.lua
@@ -170,7 +170,7 @@ end
170-- If the arch field is omitted, the local architecture (cfg.arch) 170-- If the arch field is omitted, the local architecture (cfg.arch)
171-- is used. The special value "any" is also recognized, returning all 171-- is used. The special value "any" is also recognized, returning all
172-- matches regardless of architecture. 172-- matches regardless of architecture.
173-- @return true or, in case of errors, nil and an error message. 173-- @return true or, in case of errors, nil, an error message and an optional error code.
174function search.manifest_search(results, repo, query) 174function search.manifest_search(results, repo, query)
175 assert(type(results) == "table") 175 assert(type(results) == "table")
176 assert(type(repo) == "string") 176 assert(type(repo) == "string")