diff options
author | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-10-11 06:17:26 +0000 |
---|---|---|
committer | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-10-11 06:17:26 +0000 |
commit | 5e2f598508f8ddab5aaf8b9072f1c0cab249830d (patch) | |
tree | 518adb5054a2244aa2b2ec861ccfe78d53404c54 /src | |
parent | 2eca718fc06f38bce7ffef05a6c6c647c0e025f1 (diff) | |
download | luarocks-5e2f598508f8ddab5aaf8b9072f1c0cab249830d.tar.gz luarocks-5e2f598508f8ddab5aaf8b9072f1c0cab249830d.tar.bz2 luarocks-5e2f598508f8ddab5aaf8b9072f1c0cab249830d.zip |
fix installation of bin files
git-svn-id: http://luarocks.org/svn/luarocks/trunk@86 9ca3f7c1-7366-0410-b1a3-b5c78f85698c
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/fs/unix.lua | 2 | ||||
-rw-r--r-- | src/luarocks/path.lua | 1 | ||||
-rw-r--r-- | src/luarocks/rep.lua | 7 |
3 files changed, 3 insertions, 7 deletions
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) | |||
41 | assert(type(dest) == "string") | 41 | assert(type(dest) == "string") |
42 | 42 | ||
43 | local base = dir.base_name(file) | 43 | local base = dir.base_name(file) |
44 | local wrapname = dest.."/"..base | 44 | local wrapname = fs.is_dir(dest) and dest.."/"..base or dest |
45 | local wrapper = io.open(wrapname, "w") | 45 | local wrapper = io.open(wrapname, "w") |
46 | if not wrapper then | 46 | if not wrapper then |
47 | return nil, "Could not open "..wrapname.." for writing." | 47 | 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) | |||
230 | name = name:gsub(dir.separator, ".") | 230 | name = name:gsub(dir.separator, ".") |
231 | end | 231 | end |
232 | end | 232 | end |
233 | if not name then name = file end | ||
233 | name = name:gsub("^%.+", ""):gsub("%.+$", "") | 234 | name = name:gsub("^%.+", ""):gsub("%.+$", "") |
234 | return name | 235 | return name |
235 | end | 236 | 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) | |||
94 | 94 | ||
95 | local result = {} | 95 | local result = {} |
96 | local rock_manifest = manif.load_rock_manifest(package, version) | 96 | local rock_manifest = manif.load_rock_manifest(package, version) |
97 | |||
98 | store_package_data(result, package, rock_manifest.lib) | 97 | store_package_data(result, package, rock_manifest.lib) |
99 | store_package_data(result, package, rock_manifest.lua) | 98 | store_package_data(result, package, rock_manifest.lua) |
100 | return result | 99 | return result |
@@ -114,11 +113,7 @@ function package_commands(package, version) | |||
114 | 113 | ||
115 | local result = {} | 114 | local result = {} |
116 | local rock_manifest = manif.load_rock_manifest(package, version) | 115 | local rock_manifest = manif.load_rock_manifest(package, version) |
117 | if rock_manifest.bin then | 116 | store_package_data(result, package, rock_manifest.bin) |
118 | for name,sub in pairs(rock_manifest.bin) do | ||
119 | store_package_data(result, name, sub, "", "") | ||
120 | end | ||
121 | end | ||
122 | return result | 117 | return result |
123 | end | 118 | end |
124 | 119 | ||