diff options
-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 |