diff options
-rw-r--r-- | src/luarocks/build/builtin.lua | 4 | ||||
-rw-r--r-- | src/luarocks/path.lua | 10 | ||||
-rw-r--r-- | src/luarocks/remove.lua | 7 | ||||
-rw-r--r-- | src/luarocks/show.lua | 4 |
4 files changed, 20 insertions, 5 deletions
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index e0f1c848..853b0361 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua | |||
@@ -240,8 +240,8 @@ function run(rockspec) | |||
240 | end | 240 | end |
241 | if ok then | 241 | if ok then |
242 | if fs.is_dir("lua") then | 242 | if fs.is_dir("lua") then |
243 | ok = fs.copy_contents("lua", luadir) | 243 | ok, err = fs.copy_contents("lua", luadir) |
244 | if not ok then err = "Failed copying contents of 'lua' directory." end | 244 | if not ok then err = "Failed copying contents of 'lua' directory: "..err end |
245 | end | 245 | end |
246 | end | 246 | end |
247 | if ok then | 247 | if ok then |
diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua index 64a203ef..2ce0e078 100644 --- a/src/luarocks/path.lua +++ b/src/luarocks/path.lua | |||
@@ -37,11 +37,19 @@ end | |||
37 | 37 | ||
38 | function root_dir(rocks_dir) | 38 | function root_dir(rocks_dir) |
39 | assert(type(rocks_dir) == "string") | 39 | assert(type(rocks_dir) == "string") |
40 | |||
41 | local suffix = dir.path("lib", "luarocks") | 40 | local suffix = dir.path("lib", "luarocks") |
42 | return rocks_dir:match("(.*)" .. suffix .. ".*$") | 41 | return rocks_dir:match("(.*)" .. suffix .. ".*$") |
43 | end | 42 | end |
44 | 43 | ||
44 | function rocks_tree_to_string(tree) | ||
45 | if type(tree) == "string" then | ||
46 | return tree | ||
47 | else | ||
48 | assert(type(tree) == "table") | ||
49 | return tree.root | ||
50 | end | ||
51 | end | ||
52 | |||
45 | function deploy_bin_dir(tree) | 53 | function deploy_bin_dir(tree) |
46 | if type(tree) == "string" then | 54 | if type(tree) == "string" then |
47 | return dir.path(tree, "bin") | 55 | return dir.path(tree, "bin") |
diff --git a/src/luarocks/remove.lua b/src/luarocks/remove.lua index 126cfdc8..8c899a0a 100644 --- a/src/luarocks/remove.lua +++ b/src/luarocks/remove.lua | |||
@@ -87,6 +87,13 @@ function run(...) | |||
87 | 87 | ||
88 | local ok, err = fs.check_command_permissions(flags) | 88 | local ok, err = fs.check_command_permissions(flags) |
89 | if not ok then return nil, err end | 89 | if not ok then return nil, err end |
90 | |||
91 | local rock_type = name:match("%.(rock)$") or name:match("%.(rockspec)$") | ||
92 | local filename = name | ||
93 | if rock_type then | ||
94 | name, version = path.parse_name(filename) | ||
95 | if not name then return nil, "Invalid "..rock_type.." filename: "..filename end | ||
96 | end | ||
90 | 97 | ||
91 | local results = {} | 98 | local results = {} |
92 | search.manifest_search(results, cfg.rocks_dir, search.make_query(name, version)) | 99 | search.manifest_search(results, cfg.rocks_dir, search.make_query(name, version)) |
diff --git a/src/luarocks/show.lua b/src/luarocks/show.lua index 7849934d..a6a53d9a 100644 --- a/src/luarocks/show.lua +++ b/src/luarocks/show.lua | |||
@@ -115,7 +115,7 @@ function run(...) | |||
115 | if not manifest then return nil,err end | 115 | if not manifest then return nil,err end |
116 | local minfo = manifest.repository[name][version][1] | 116 | local minfo = manifest.repository[name][version][1] |
117 | 117 | ||
118 | if flags["rock-tree"] then util.printout(repo) | 118 | if flags["rock-tree"] then util.printout(path.rocks_tree_to_string(repo)) |
119 | elseif flags["rock-dir"] then util.printout(directory) | 119 | elseif flags["rock-dir"] then util.printout(directory) |
120 | elseif flags["home"] then util.printout(descript.homepage) | 120 | elseif flags["home"] then util.printout(descript.homepage) |
121 | elseif flags["modules"] then util.printout(keys_as_string(minfo.modules)) | 121 | elseif flags["modules"] then util.printout(keys_as_string(minfo.modules)) |
@@ -136,7 +136,7 @@ function run(...) | |||
136 | if descript.homepage then | 136 | if descript.homepage then |
137 | util.printout("Homepage: ", descript.homepage) | 137 | util.printout("Homepage: ", descript.homepage) |
138 | end | 138 | end |
139 | util.printout("Installed in: ", repo) | 139 | util.printout("Installed in: ", path.rocks_tree_to_string(repo)) |
140 | if next(minfo.modules) then | 140 | if next(minfo.modules) then |
141 | util.printout() | 141 | util.printout() |
142 | util.printout("Modules:") | 142 | util.printout("Modules:") |