diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2011-12-25 17:32:51 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2011-12-25 17:32:51 -0200 |
commit | d0257cc8287fa0dccccbc4b9e707a4db25490293 (patch) | |
tree | 74b0a1ef343d81cf0f6a1e3e3b611c8b6a25c5e6 /src | |
parent | 0a22d668c806f30185c74b30bb7a75a7794f763b (diff) | |
download | luarocks-d0257cc8287fa0dccccbc4b9e707a4db25490293.tar.gz luarocks-d0257cc8287fa0dccccbc4b9e707a4db25490293.tar.bz2 luarocks-d0257cc8287fa0dccccbc4b9e707a4db25490293.zip |
Modify behavior on build.install for string keys. The rockspec format was
underspecified in this particular point, and rockspec authors assumed
something different from what I implemented. Now things should work as
developers seem to expect.
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/build.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua index aa39ac9e..3c015920 100644 --- a/src/luarocks/build.lua +++ b/src/luarocks/build.lua | |||
@@ -46,10 +46,18 @@ local function install_files(files, location, is_module_path) | |||
46 | if files then | 46 | if files then |
47 | for k, file in pairs(files) do | 47 | for k, file in pairs(files) do |
48 | local dest = location | 48 | local dest = location |
49 | if type(k) == "string" then | 49 | if is_module_path then |
50 | dest = is_module_path and dir.path(location, path.module_to_path(k)) or k | 50 | if type(k) == "string" then |
51 | dest = dir.path(location, path.module_to_path(k)) | ||
52 | end | ||
53 | fs.make_dir(dest) | ||
54 | else | ||
55 | if type(k) == "string" then | ||
56 | dest = dir.path(location, dir.dir_name(k)) | ||
57 | end | ||
58 | fs.make_dir(dest) | ||
59 | dest = dir.path(dest, dir.base_name(k)) | ||
51 | end | 60 | end |
52 | fs.make_dir(dest) | ||
53 | local ok = fs.copy(dir.path(file), dest) | 61 | local ok = fs.copy(dir.path(file), dest) |
54 | if not ok then | 62 | if not ok then |
55 | return nil, "Failed copying "..file | 63 | return nil, "Failed copying "..file |