From 0402bceb92a5eb6a4650856b080953826229309d Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 8 Jan 2014 16:28:54 -0200 Subject: Check if unzip failed --- src/luarocks/manif.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua index ed1780b3..3fb3e4e3 100644 --- a/src/luarocks/manif.lua +++ b/src/luarocks/manif.lua @@ -141,12 +141,18 @@ function load_manifest(repo_url) end end if pathname:match(".*%.zip$") then + pathname = fs.absolute_name(pathname) local dir = dir.dir_name(pathname) fs.change_dir(dir) local nozip = pathname:match("(.*)%.zip$") fs.delete(nozip) - fs.unzip(pathname) + local ok = fs.unzip(pathname) fs.pop_dir() + if not ok then + fs.delete(pathname) + fs.delete(pathname..".timestamp") + return nil, "Failed extracting manifest file" + end pathname = nozip end return manif_core.manifest_loader(pathname, repo_url) -- cgit v1.2.3-55-g6feb