diff options
author | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-10-05 18:20:20 +0000 |
---|---|---|
committer | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-10-05 18:20:20 +0000 |
commit | d1d1231472e7aa1dc005acb827dd28ee060dd574 (patch) | |
tree | d7568d95b81e96b5eca1ce5dabd93c599959a9bc | |
parent | 726520068fd629d270be0872c193b3bd0fde2a64 (diff) | |
download | luarocks-d1d1231472e7aa1dc005acb827dd28ee060dd574.tar.gz luarocks-d1d1231472e7aa1dc005acb827dd28ee060dd574.tar.bz2 luarocks-d1d1231472e7aa1dc005acb827dd28ee060dd574.zip |
add extra checking
git-svn-id: http://luarocks.org/svn/luarocks/trunk@66 9ca3f7c1-7366-0410-b1a3-b5c78f85698c
-rw-r--r-- | src/luarocks/rep.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/luarocks/rep.lua b/src/luarocks/rep.lua index eaedb991..ffe5a87c 100644 --- a/src/luarocks/rep.lua +++ b/src/luarocks/rep.lua | |||
@@ -280,6 +280,7 @@ function delete_version(name, version) | |||
280 | local target = dir.path(deploy_dir, file) | 280 | local target = dir.path(deploy_dir, file) |
281 | if type(sub) == "table" then | 281 | if type(sub) == "table" then |
282 | local ok, err = delete_deployed_file_tree(sub, target) | 282 | local ok, err = delete_deployed_file_tree(sub, target) |
283 | if not ok then return nil, err end | ||
283 | fs.remove_dir_if_empty(target) | 284 | fs.remove_dir_if_empty(target) |
284 | else | 285 | else |
285 | local versioned = path.versioned_name(target, name, version) | 286 | local versioned = path.versioned_name(target, name, version) |
@@ -294,6 +295,10 @@ function delete_version(name, version) | |||
294 | end | 295 | end |
295 | 296 | ||
296 | local rock_manifest = manif.load_rock_manifest(name, version) | 297 | local rock_manifest = manif.load_rock_manifest(name, version) |
298 | if not rock_manifest then | ||
299 | return nil, "rock_manifest file not found for "..name.." "..version.." - not a LuaRocks 2 tree?" | ||
300 | end | ||
301 | |||
297 | local ok, err = true | 302 | local ok, err = true |
298 | if rock_manifest.bin then | 303 | if rock_manifest.bin then |
299 | ok, err = delete_deployed_file_tree(rock_manifest.bin, cfg.deploy_bin_dir) | 304 | ok, err = delete_deployed_file_tree(rock_manifest.bin, cfg.deploy_bin_dir) |