diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2014-01-08 16:28:54 -0200 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-01-10 16:42:32 -0200 |
| commit | 0402bceb92a5eb6a4650856b080953826229309d (patch) | |
| tree | cb10c1129fdace88d9a514fa137961ae1fbce4f9 | |
| parent | a1470202d55e5bf25c6326bed693aa43c1f4727d (diff) | |
| download | luarocks-0402bceb92a5eb6a4650856b080953826229309d.tar.gz luarocks-0402bceb92a5eb6a4650856b080953826229309d.tar.bz2 luarocks-0402bceb92a5eb6a4650856b080953826229309d.zip | |
Check if unzip failed
| -rw-r--r-- | src/luarocks/manif.lua | 8 |
1 files changed, 7 insertions, 1 deletions
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) | |||
| 141 | end | 141 | end |
| 142 | end | 142 | end |
| 143 | if pathname:match(".*%.zip$") then | 143 | if pathname:match(".*%.zip$") then |
| 144 | pathname = fs.absolute_name(pathname) | ||
| 144 | local dir = dir.dir_name(pathname) | 145 | local dir = dir.dir_name(pathname) |
| 145 | fs.change_dir(dir) | 146 | fs.change_dir(dir) |
| 146 | local nozip = pathname:match("(.*)%.zip$") | 147 | local nozip = pathname:match("(.*)%.zip$") |
| 147 | fs.delete(nozip) | 148 | fs.delete(nozip) |
| 148 | fs.unzip(pathname) | 149 | local ok = fs.unzip(pathname) |
| 149 | fs.pop_dir() | 150 | fs.pop_dir() |
| 151 | if not ok then | ||
| 152 | fs.delete(pathname) | ||
| 153 | fs.delete(pathname..".timestamp") | ||
| 154 | return nil, "Failed extracting manifest file" | ||
| 155 | end | ||
| 150 | pathname = nozip | 156 | pathname = nozip |
| 151 | end | 157 | end |
| 152 | return manif_core.manifest_loader(pathname, repo_url) | 158 | return manif_core.manifest_loader(pathname, repo_url) |
