summaryrefslogtreecommitdiff
path: root/xmake/modules/utils
diff options
context:
space:
mode:
authorruki <[email protected]>2021-08-13 14:30:35 +0800
committerGitHub <[email protected]>2021-08-13 14:30:35 +0800
commit26c6499f97244bc6c663777b2f765bf594a290d5 (patch)
tree27f1c56a562e9a5ee01efa2ac1591995198a937f /xmake/modules/utils
parentb9190cc9abfb901cad0955011268be618fa0cc6b (diff)
Update extract.lua
Diffstat (limited to 'xmake/modules/utils')
-rw-r--r--xmake/modules/utils/archive/extract.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/xmake/modules/utils/archive/extract.lua b/xmake/modules/utils/archive/extract.lua
index 2c0b8fb8d..f8f348bcb 100644
--- a/xmake/modules/utils/archive/extract.lua
+++ b/xmake/modules/utils/archive/extract.lua
@@ -44,7 +44,7 @@ function _extract_using_tar(archivefile, outputdir, extension, opt)
end
-- on msys2/cygwin? we need translate input path to cygwin-like path
- if is_subhost("msys", "cygwin") and program:gsub("\\", "/"):find("/usr/bin") then
+ if is_subhost("msys", "cygwin") then
archivefile = path.cygwin_path(archivefile)
end
@@ -98,6 +98,12 @@ function _extract_using_7z(archivefile, outputdir, extension, opt)
return false
end
+ -- p7zip cannot extract other archive format on msys/cygwin
+ -- https://github.com/xmake-io/xmake/issues/1575#issuecomment-898205462
+ if is_subhost("msys", "cygwin") and extension ~= ".7z" and program:startswith("sh ") then
+ return false
+ end
+
-- extract to *.tar file first
local outputdir_old = nil
if extension:startswith(".tar.") or extension == ".tgz" then
@@ -389,11 +395,15 @@ end
-- extract archive file using extractors
function _extract(archivefile, outputdir, extension, extractors, opt)
+
+ -- extract it
for _, extract in ipairs(extractors) do
if extract(archivefile, outputdir, extension, opt) then
return true
end
end
+
+ -- failed
return false
end