diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2016-06-22 20:19:57 +0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-06-22 20:49:35 +0300 |
commit | 1138929e64fb9d891cea370552b99bb44b31e23a (patch) | |
tree | b9257cf1eca837c929b235be8360eac730f2cc13 | |
parent | ad5576263538aa61a92e4c97bf5e52fc134bda22 (diff) | |
download | luarocks-1138929e64fb9d891cea370552b99bb44b31e23a.tar.gz luarocks-1138929e64fb9d891cea370552b99bb44b31e23a.tar.bz2 luarocks-1138929e64fb9d891cea370552b99bb44b31e23a.zip |
Handle unpack_archive errors
In particular, when installing a rock, fail with a message related
to extraction error or unrecognized archive extension instead of
'Directory <name> not found inside archive <name>.<ext>'.
-rw-r--r-- | src/luarocks/fetch.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua index dfa6f191..824a3731 100644 --- a/src/luarocks/fetch.lua +++ b/src/luarocks/fetch.lua | |||
@@ -344,7 +344,8 @@ function fetch.get_sources(rockspec, extract, dest_dir) | |||
344 | if extract then | 344 | if extract then |
345 | local ok, err = fs.change_dir(store_dir) | 345 | local ok, err = fs.change_dir(store_dir) |
346 | if not ok then return nil, err end | 346 | if not ok then return nil, err end |
347 | fs.unpack_archive(rockspec.source.file) | 347 | ok, err = fs.unpack_archive(rockspec.source.file) |
348 | if not ok then return nil, err end | ||
348 | if not fs.exists(rockspec.source.dir) then | 349 | if not fs.exists(rockspec.source.dir) then |
349 | return nil, "Directory "..rockspec.source.dir.." not found inside archive "..rockspec.source.file, "source.dir", source_file, store_dir | 350 | return nil, "Directory "..rockspec.source.dir.." not found inside archive "..rockspec.source.file, "source.dir", source_file, store_dir |
350 | end | 351 | end |