aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2016-04-14 15:26:32 -0300
committerHisham Muhammad <hisham@gobolinux.org>2016-04-14 15:26:32 -0300
commit3576869364203e2325a03960dd2c0d618355cb63 (patch)
tree74f5db1bb7c5473ce5b47acaca38a2fefe7e9a0f /src
parentfde1b0777855999d5ef04585d73a1a2046ce517d (diff)
parent6fc4b35d4e89e83e15c47d0163c3ced47f236b7d (diff)
downloadluarocks-3576869364203e2325a03960dd2c0d618355cb63.tar.gz
luarocks-3576869364203e2325a03960dd2c0d618355cb63.tar.bz2
luarocks-3576869364203e2325a03960dd2c0d618355cb63.zip
Merge pull request #497 from mpeterv/fix-unpack-archive
Fix loud archive unpacking
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/fs/unix/tools.lua12
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
293function tools.unpack_archive(archive) 293function 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