From d0257cc8287fa0dccccbc4b9e707a4db25490293 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sun, 25 Dec 2011 17:32:51 -0200 Subject: 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. --- src/luarocks/build.lua | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') 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) if files then for k, file in pairs(files) do local dest = location - if type(k) == "string" then - dest = is_module_path and dir.path(location, path.module_to_path(k)) or k + if is_module_path then + if type(k) == "string" then + dest = dir.path(location, path.module_to_path(k)) + end + fs.make_dir(dest) + else + if type(k) == "string" then + dest = dir.path(location, dir.dir_name(k)) + end + fs.make_dir(dest) + dest = dir.path(dest, dir.base_name(k)) end - fs.make_dir(dest) local ok = fs.copy(dir.path(file), dest) if not ok then return nil, "Failed copying "..file -- cgit v1.2.3-55-g6feb