diff options
| author | Paul Ouellette <oue.paul18@gmail.com> | 2019-08-12 15:31:14 -0400 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-08-27 12:54:36 -0300 |
| commit | 91ecea77c6e01e5bf3e0a15ea2146c0a0dbcd573 (patch) | |
| tree | 176968b32a0cbf112c6461ec8ce81aefb8177d7a | |
| parent | bd6009326fb468890ddabc16d6014916f08710ff (diff) | |
| download | luarocks-91ecea77c6e01e5bf3e0a15ea2146c0a0dbcd573.tar.gz luarocks-91ecea77c6e01e5bf3e0a15ea2146c0a0dbcd573.tar.bz2 luarocks-91ecea77c6e01e5bf3e0a15ea2146c0a0dbcd573.zip | |
Fix wrong versions in search failure error message
| -rw-r--r-- | src/luarocks/manif.lua | 6 | ||||
| -rw-r--r-- | src/luarocks/search.lua | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua index 45130696..8784f327 100644 --- a/src/luarocks/manif.lua +++ b/src/luarocks/manif.lua | |||
| @@ -91,9 +91,11 @@ end | |||
| 91 | -- through this function. | 91 | -- through this function. |
| 92 | -- @param repo_url string: URL or pathname for the repository. | 92 | -- @param repo_url string: URL or pathname for the repository. |
| 93 | -- @param lua_version string: Lua version in "5.x" format, defaults to installed version. | 93 | -- @param lua_version string: Lua version in "5.x" format, defaults to installed version. |
| 94 | -- @param versioned_only boolean: If true, do not fall back to the main manifest | ||
| 95 | -- if a versioned manifest was not found. | ||
| 94 | -- @return table or (nil, string, [string]): A table representing the manifest, | 96 | -- @return table or (nil, string, [string]): A table representing the manifest, |
| 95 | -- or nil followed by an error message and an optional error code. | 97 | -- or nil followed by an error message and an optional error code. |
| 96 | function manif.load_manifest(repo_url, lua_version) | 98 | function manif.load_manifest(repo_url, lua_version, versioned_only) |
| 97 | assert(type(repo_url) == "string") | 99 | assert(type(repo_url) == "string") |
| 98 | assert(type(lua_version) == "string" or not lua_version) | 100 | assert(type(lua_version) == "string" or not lua_version) |
| 99 | lua_version = lua_version or cfg.lua_version | 101 | lua_version = lua_version or cfg.lua_version |
| @@ -107,7 +109,7 @@ function manif.load_manifest(repo_url, lua_version) | |||
| 107 | local filenames = { | 109 | local filenames = { |
| 108 | "manifest-"..lua_version..".zip", | 110 | "manifest-"..lua_version..".zip", |
| 109 | "manifest-"..lua_version, | 111 | "manifest-"..lua_version, |
| 110 | "manifest", | 112 | not versioned_only and "manifest" or nil, |
| 111 | } | 113 | } |
| 112 | 114 | ||
| 113 | local protocol, repodir = dir.split_url(repo_url) | 115 | local protocol, repodir = dir.split_url(repo_url) |
diff --git a/src/luarocks/search.lua b/src/luarocks/search.lua index e5ee9b47..46c47309 100644 --- a/src/luarocks/search.lua +++ b/src/luarocks/search.lua | |||
| @@ -108,7 +108,7 @@ local function manifest_search(result_tree, repo, query, lua_version, is_local) | |||
| 108 | repo = repo .. "/manifests/" .. query.namespace | 108 | repo = repo .. "/manifests/" .. query.namespace |
| 109 | end | 109 | end |
| 110 | 110 | ||
| 111 | local manifest, err, errcode = manif.load_manifest(repo, lua_version) | 111 | local manifest, err, errcode = manif.load_manifest(repo, lua_version, true) |
| 112 | if not manifest then | 112 | if not manifest then |
| 113 | return nil, err, errcode | 113 | return nil, err, errcode |
| 114 | end | 114 | end |
