diff options
author | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-06-27 21:43:52 +0000 |
---|---|---|
committer | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-06-27 21:43:52 +0000 |
commit | ce672efef7e64b31d53dc1539470932bfd094ee6 (patch) | |
tree | 9aa6ed17fa3cbd6e198f7f74cfbbbf37e7a22bd2 /src | |
parent | 4b7f40cb05c6a9b5f838012d6e652d540d94f8cd (diff) | |
download | luarocks-ce672efef7e64b31d53dc1539470932bfd094ee6.tar.gz luarocks-ce672efef7e64b31d53dc1539470932bfd094ee6.tar.bz2 luarocks-ce672efef7e64b31d53dc1539470932bfd094ee6.zip |
start populating global lib/ directory.
git-svn-id: http://luarocks.org/svn/luarocks/trunk@33 9ca3f7c1-7366-0410-b1a3-b5c78f85698c
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. |