aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/manif.lua21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua
index 6bf3fe15..f5a3559a 100644
--- a/src/luarocks/manif.lua
+++ b/src/luarocks/manif.lua
@@ -13,6 +13,9 @@ local fetch = require("luarocks.fetch")
13local dir = require("luarocks.dir") 13local dir = require("luarocks.dir")
14local manif_core = require("luarocks.manif_core") 14local manif_core = require("luarocks.manif_core")
15 15
16local function make_global_lib(repo, manifest)
17end
18
16--- Load a local or remote manifest describing a repository. 19--- Load a local or remote manifest describing a repository.
17-- All functions that use manifest tables assume they were obtained 20-- All functions that use manifest tables assume they were obtained
18-- through either this function or load_local_manifest. 21-- through either this function or load_local_manifest.
@@ -163,16 +166,16 @@ local function store_results(results, manifest)
163 166
164 for pkg, versions in pairs(results) do 167 for pkg, versions in pairs(results) do
165 local pkgtable = manifest.repository[pkg] or {} 168 local pkgtable = manifest.repository[pkg] or {}
166 for version, repos in pairs(versions) do 169 for version, entries in pairs(versions) do
167 local versiontable = {} 170 local versiontable = {}
168 for _, repo in ipairs(repos) do 171 for _, entry in ipairs(entries) do
169 local repotable = {} 172 local entrytable = {}
170 repotable.arch = repo.arch 173 entrytable.arch = entry.arch
171 if repo.arch == "installed" then 174 if entry.arch == "installed" then
172 repotable.modules = store_package_items(rep.package_modules, pkg, version, manifest.modules) 175 entrytable.modules = store_package_items(rep.package_modules, pkg, version, manifest.modules)
173 repotable.commands = store_package_items(rep.package_commands, pkg, version, manifest.commands) 176 entrytable.commands = store_package_items(rep.package_commands, pkg, version, manifest.commands)
174 end 177 end
175 table.insert(versiontable, repotable) 178 table.insert(versiontable, entrytable)
176 end 179 end
177 pkgtable[version] = versiontable 180 pkgtable[version] = versiontable
178 end 181 end
@@ -217,6 +220,7 @@ function update_manifest(name, version, repo)
217 local results = {[name] = {[version] = {{arch = "installed", repo = repo}}}} 220 local results = {[name] = {[version] = {{arch = "installed", repo = repo}}}}
218 221
219 store_results(results, manifest) 222 store_results(results, manifest)
223 make_global_lib(repo, manifest)
220 return save_manifest(repo, manifest) 224 return save_manifest(repo, manifest)
221end 225end
222 226
@@ -240,6 +244,7 @@ function make_manifest(repo)
240 local manifest = { repository = {}, modules = {}, commands = {} } 244 local manifest = { repository = {}, modules = {}, commands = {} }
241 manif_core.manifest_cache[repo] = manifest 245 manif_core.manifest_cache[repo] = manifest
242 store_results(results, manifest) 246 store_results(results, manifest)
247 make_global_lib(repo, manifest)
243 return save_manifest(repo, manifest) 248 return save_manifest(repo, manifest)
244end 249end
245 250