diff options
| author | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-06-12 22:29:34 +0000 |
|---|---|---|
| committer | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-06-12 22:29:34 +0000 |
| commit | 0859f85d42be5305e863c2a831f6a8b35b3262f9 (patch) | |
| tree | f95e12091ad8fa71062de63106cec5c26addab31 /src | |
| parent | 0f2b7ef0feeeead5edfbb087b4713addb026c739 (diff) | |
| download | luarocks-0859f85d42be5305e863c2a831f6a8b35b3262f9.tar.gz luarocks-0859f85d42be5305e863c2a831f6a8b35b3262f9.tar.bz2 luarocks-0859f85d42be5305e863c2a831f6a8b35b3262f9.zip | |
Add entry point for unified lib directory
git-svn-id: http://luarocks.org/svn/luarocks/trunk@26 9ca3f7c1-7366-0410-b1a3-b5c78f85698c
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/manif.lua | 21 |
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") | |||
| 13 | local dir = require("luarocks.dir") | 13 | local dir = require("luarocks.dir") |
| 14 | local manif_core = require("luarocks.manif_core") | 14 | local manif_core = require("luarocks.manif_core") |
| 15 | 15 | ||
| 16 | local function make_global_lib(repo, manifest) | ||
| 17 | end | ||
| 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) |
| 221 | end | 225 | end |
| 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) |
| 244 | end | 249 | end |
| 245 | 250 | ||
