diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/manif.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua index f1e05d92..6974dc04 100644 --- a/src/luarocks/manif.lua +++ b/src/luarocks/manif.lua | |||
@@ -14,6 +14,24 @@ 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) | 16 | local function make_global_lib(repo, manifest) |
17 | local lib_dir = dir.path(dir.dir_name(repo), "lib") | ||
18 | fs.make_dir(lib_dir) | ||
19 | for rock, modules in pairs(manifest.modules) do | ||
20 | for module, file in pairs(modules) do | ||
21 | local path_in_rock = dir.strip_base_dir(file:sub(#dir.path(repo, module)+2)) | ||
22 | local module_dir = dir.dir_name(path_in_rock) | ||
23 | local dest = dir.path(lib_dir, path_in_rock) | ||
24 | if module_dir ~= "" then | ||
25 | fs.make_dir(dir.dir_name(dest)) | ||
26 | end | ||
27 | if not fs.exists(dest) then | ||
28 | fs.copy(file, dest) | ||
29 | manifest.modules[rock][module] = dest | ||
30 | else | ||
31 | -- TODO | ||
32 | end | ||
33 | end | ||
34 | end | ||
17 | end | 35 | end |
18 | 36 | ||
19 | --- Load a local or remote manifest describing a repository. | 37 | --- Load a local or remote manifest describing a repository. |