From b691a57e180fc7d20d2684e00583a5d570183073 Mon Sep 17 00:00:00 2001 From: hisham Date: Fri, 20 Nov 2009 14:19:47 +0000 Subject: Search fixes by David Manura git-svn-id: http://luarocks.org/svn/luarocks/trunk@124 9ca3f7c1-7366-0410-b1a3-b5c78f85698c --- src/luarocks/search.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/luarocks/search.lua b/src/luarocks/search.lua index f48dc567..adbf47a8 100644 --- a/src/luarocks/search.lua +++ b/src/luarocks/search.lua @@ -165,6 +165,7 @@ end -- If the arch field is omitted, the local architecture (cfg.arch) -- is used. The special value "any" is also recognized, returning all -- matches regardless of architecture. +-- @return true or, in case of errors, nil and an error message. function manifest_search(results, repo, query) assert(type(results) == "table") assert(type(repo) == "string") @@ -173,7 +174,7 @@ function manifest_search(results, repo, query) query_arch_as_table(query) local manifest, err = manif.load_manifest(repo) if not manifest then - return + return nil, "Failed loading manifest: "..err end for name, versions in pairs(manifest.repository) do for version, items in pairs(versions) do @@ -182,6 +183,7 @@ function manifest_search(results, repo, query) end end end + return true end --- Search on all configured rocks servers. @@ -199,7 +201,10 @@ function search_repos(query) if protocol == "file" then repo = pathname end - manifest_search(results, repo, query) + local ok, err = manifest_search(results, repo, query) + if not ok then + util.warning("Failed searching manifest: "..err) + end end return results end @@ -362,7 +367,7 @@ function run(...) local flags, name, version = util.parse_flags(...) if flags["all"] then - name, version = "", "" + name, version = "", nil end if type(name) ~= "string" and not flags["all"] then -- cgit v1.2.3-55-g6feb