diff options
| author | Philipp Janda <siffiejoe@gmx.net> | 2014-02-27 09:56:51 +0100 |
|---|---|---|
| committer | Philipp Janda <siffiejoe@gmx.net> | 2014-02-27 09:56:51 +0100 |
| commit | 1fe765085b54922716dd053f824e05a5e479366e (patch) | |
| tree | 6df3fc20bdc18e56202cf159c6379a1b685ed9f0 /src | |
| parent | b14d3f96bca39843b652a1a61f67968052a1b1a0 (diff) | |
| download | luarocks-1fe765085b54922716dd053f824e05a5e479366e.tar.gz luarocks-1fe765085b54922716dd053f824e05a5e479366e.tar.bz2 luarocks-1fe765085b54922716dd053f824e05a5e479366e.zip | |
handle implict subdirectories when unpacking with LuaZip
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/fs/lua.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua index ea16b728..1a7b6be6 100644 --- a/src/luarocks/fs/lua.lua +++ b/src/luarocks/fs/lua.lua | |||
| @@ -498,6 +498,11 @@ function fs_lua.unzip(zipfile) | |||
| 498 | local ok, err = fs.make_dir(dir.path(fs.current_dir(), file.filename)) | 498 | local ok, err = fs.make_dir(dir.path(fs.current_dir(), file.filename)) |
| 499 | if not ok then return nil, err end | 499 | if not ok then return nil, err end |
| 500 | else | 500 | else |
| 501 | local base = dir.dir_name(file.filename) | ||
| 502 | if base ~= "" and not fs.is_dir(base) then | ||
| 503 | local ok, err = fs.make_dir(dir.path(fs.current_dir(), base)) | ||
| 504 | if not ok then return nil, err end | ||
| 505 | end | ||
| 501 | local rf, err = zipfile:open(file.filename) | 506 | local rf, err = zipfile:open(file.filename) |
| 502 | if not rf then zipfile:close(); return nil, err end | 507 | if not rf then zipfile:close(); return nil, err end |
| 503 | local contents = rf:read("*a") | 508 | local contents = rf:read("*a") |
