diff options
author | mpeterv <mpeterval@gmail.com> | 2016-04-14 19:53:12 +0300 |
---|---|---|
committer | mpeterv <mpeterval@gmail.com> | 2016-04-14 19:53:12 +0300 |
commit | 6fc4b35d4e89e83e15c47d0163c3ced47f236b7d (patch) | |
tree | 74f5db1bb7c5473ce5b47acaca38a2fefe7e9a0f | |
parent | fde1b0777855999d5ef04585d73a1a2046ce517d (diff) | |
download | luarocks-6fc4b35d4e89e83e15c47d0163c3ced47f236b7d.tar.gz luarocks-6fc4b35d4e89e83e15c47d0163c3ced47f236b7d.tar.bz2 luarocks-6fc4b35d4e89e83e15c47d0163c3ced47f236b7d.zip |
Fix loud archive unpacking
In luarocks.fs.unix.tools.unpack_archive execute commands in quiet
mode (that is, silenced by default, but not with --verbose), like
in luarocks.fs.unzip and luarocks.fs.win32.tools.unpack_archive.
-rw-r--r-- | src/luarocks/fs/unix/tools.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua index fed9c426..767bae4d 100644 --- a/src/luarocks/fs/unix/tools.lua +++ b/src/luarocks/fs/unix/tools.lua | |||
@@ -293,13 +293,19 @@ end | |||
293 | function tools.unpack_archive(archive) | 293 | function tools.unpack_archive(archive) |
294 | assert(type(archive) == "string") | 294 | assert(type(archive) == "string") |
295 | 295 | ||
296 | local pipe_to_tar = " | "..vars.TAR.." -xf -" | ||
297 | |||
298 | if not cfg.verbose then | ||
299 | pipe_to_tar = " 2> /dev/null"..fs.quiet(pipe_to_tar) | ||
300 | end | ||
301 | |||
296 | local ok | 302 | local ok |
297 | if archive:match("%.tar%.gz$") or archive:match("%.tgz$") then | 303 | if archive:match("%.tar%.gz$") or archive:match("%.tgz$") then |
298 | ok = fs.execute_string(vars.GUNZIP.." -c "..fs.Q(archive).." | "..vars.TAR.." -xf -") | 304 | ok = fs.execute_string(vars.GUNZIP.." -c "..fs.Q(archive)..pipe_to_tar) |
299 | elseif archive:match("%.tar%.bz2$") then | 305 | elseif archive:match("%.tar%.bz2$") then |
300 | ok = fs.execute_string(vars.BUNZIP2.." -c "..fs.Q(archive).." | "..vars.TAR.." -xf -") | 306 | ok = fs.execute_string(vars.BUNZIP2.." -c "..fs.Q(archive)..pipe_to_tar) |
301 | elseif archive:match("%.zip$") then | 307 | elseif archive:match("%.zip$") then |
302 | ok = fs.execute(vars.UNZIP, archive) | 308 | ok = fs.execute_quiet(vars.UNZIP, archive) |
303 | elseif archive:match("%.lua$") or archive:match("%.c$") then | 309 | elseif archive:match("%.lua$") or archive:match("%.c$") then |
304 | -- Ignore .lua and .c files; they don't need to be extracted. | 310 | -- Ignore .lua and .c files; they don't need to be extracted. |
305 | return true | 311 | return true |