From 5e2f598508f8ddab5aaf8b9072f1c0cab249830d Mon Sep 17 00:00:00 2001 From: hisham Date: Sun, 11 Oct 2009 06:17:26 +0000 Subject: fix installation of bin files git-svn-id: http://luarocks.org/svn/luarocks/trunk@86 9ca3f7c1-7366-0410-b1a3-b5c78f85698c --- src/luarocks/fs/unix.lua | 2 +- src/luarocks/path.lua | 1 + src/luarocks/rep.lua | 7 +------ 3 files changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/luarocks/fs/unix.lua b/src/luarocks/fs/unix.lua index 0e91eea0..b63f8ee7 100644 --- a/src/luarocks/fs/unix.lua +++ b/src/luarocks/fs/unix.lua @@ -41,7 +41,7 @@ function wrap_script(file, dest) assert(type(dest) == "string") local base = dir.base_name(file) - local wrapname = dest.."/"..base + local wrapname = fs.is_dir(dest) and dest.."/"..base or dest local wrapper = io.open(wrapname, "w") if not wrapper then return nil, "Could not open "..wrapname.." for writing." diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua index 4718378e..4ea33358 100644 --- a/src/luarocks/path.lua +++ b/src/luarocks/path.lua @@ -230,6 +230,7 @@ function path_to_module(file) name = name:gsub(dir.separator, ".") end end + if not name then name = file end name = name:gsub("^%.+", ""):gsub("%.+$", "") return name end diff --git a/src/luarocks/rep.lua b/src/luarocks/rep.lua index 2b5b3158..90b79fcd 100644 --- a/src/luarocks/rep.lua +++ b/src/luarocks/rep.lua @@ -94,7 +94,6 @@ function package_modules(package, version) local result = {} local rock_manifest = manif.load_rock_manifest(package, version) - store_package_data(result, package, rock_manifest.lib) store_package_data(result, package, rock_manifest.lua) return result @@ -114,11 +113,7 @@ function package_commands(package, version) local result = {} local rock_manifest = manif.load_rock_manifest(package, version) - if rock_manifest.bin then - for name,sub in pairs(rock_manifest.bin) do - store_package_data(result, name, sub, "", "") - end - end + store_package_data(result, package, rock_manifest.bin) return result end -- cgit v1.2.3-55-g6feb