diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/manif_core.lua | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/luarocks/manif_core.lua b/src/luarocks/manif_core.lua index 5c8928d4..82e7ea4d 100644 --- a/src/luarocks/manif_core.lua +++ b/src/luarocks/manif_core.lua | |||
| @@ -88,20 +88,19 @@ end | |||
| 88 | function manif_core.get_versions(name, deps_mode) | 88 | function manif_core.get_versions(name, deps_mode) |
| 89 | assert(type(name) == "string") | 89 | assert(type(name) == "string") |
| 90 | assert(type(deps_mode) == "string") | 90 | assert(type(deps_mode) == "string") |
| 91 | 91 | ||
| 92 | local manifest = {} | 92 | local version_set = {} |
| 93 | path.map_trees(deps_mode, function(tree) | 93 | path.map_trees(deps_mode, function(tree) |
| 94 | local loaded = manif_core.load_local_manifest(path.rocks_dir(tree)) | 94 | local manifest = manif_core.load_local_manifest(path.rocks_dir(tree)) |
| 95 | if loaded then | 95 | |
| 96 | util.deep_merge(manifest, loaded) | 96 | if manifest and manifest.repository[name] then |
| 97 | for version in pairs(manifest.repository[name]) do | ||
| 98 | version_set[version] = true | ||
| 99 | end | ||
| 97 | end | 100 | end |
| 98 | end) | 101 | end) |
| 99 | 102 | ||
| 100 | local item = next(manifest) and manifest.repository[name] | 103 | return util.keys(version_set) |
| 101 | if item then | ||
| 102 | return util.keys(item) | ||
| 103 | end | ||
| 104 | return {} | ||
| 105 | end | 104 | end |
| 106 | 105 | ||
| 107 | return manif_core | 106 | return manif_core |
