diff options
author | mpeterv <mpeterval@gmail.com> | 2016-04-14 19:16:59 +0300 |
---|---|---|
committer | mpeterv <mpeterval@gmail.com> | 2016-04-14 19:17:32 +0300 |
commit | fde1b0777855999d5ef04585d73a1a2046ce517d (patch) | |
tree | 5637f55c6d76b9eeace84d2cdd47f6a9aeb403ec | |
parent | ed22f45b6837e1b2b9375e81c03e223cd5127e23 (diff) | |
download | luarocks-fde1b0777855999d5ef04585d73a1a2046ce517d.tar.gz luarocks-fde1b0777855999d5ef04585d73a1a2046ce517d.tar.bz2 luarocks-fde1b0777855999d5ef04585d73a1a2046ce517d.zip |
Quote archive name when unpacking
Also use vars.TAR instead of literal "tar" when unpacking .tar.bz2
-rw-r--r-- | src/luarocks/fs/unix/tools.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua index 442004ce..fed9c426 100644 --- a/src/luarocks/fs/unix/tools.lua +++ b/src/luarocks/fs/unix/tools.lua | |||
@@ -295,9 +295,9 @@ function tools.unpack_archive(archive) | |||
295 | 295 | ||
296 | local ok | 296 | local ok |
297 | if archive:match("%.tar%.gz$") or archive:match("%.tgz$") then | 297 | if archive:match("%.tar%.gz$") or archive:match("%.tgz$") then |
298 | ok = fs.execute_string(vars.GUNZIP.." -c "..archive.."|"..vars.TAR.." -xf -") | 298 | ok = fs.execute_string(vars.GUNZIP.." -c "..fs.Q(archive).." | "..vars.TAR.." -xf -") |
299 | elseif archive:match("%.tar%.bz2$") then | 299 | elseif archive:match("%.tar%.bz2$") then |
300 | ok = fs.execute_string(vars.BUNZIP2.." -c "..archive.."|tar -xf -") | 300 | ok = fs.execute_string(vars.BUNZIP2.." -c "..fs.Q(archive).." | "..vars.TAR.." -xf -") |
301 | elseif archive:match("%.zip$") then | 301 | elseif archive:match("%.zip$") then |
302 | ok = fs.execute(vars.UNZIP, archive) | 302 | ok = fs.execute(vars.UNZIP, archive) |
303 | elseif archive:match("%.lua$") or archive:match("%.c$") then | 303 | elseif archive:match("%.lua$") or archive:match("%.c$") then |