diff options
| author | ruki <[email protected]> | 2024-08-30 00:44:06 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-08-30 00:44:06 +0800 |
| commit | 2be67f301013b092c299f4d3c0fe61bd6d690f92 (patch) | |
| tree | 96c99a34b0deb594b7dced64111de2bb27d3a4b6 /xmake/modules | |
| parent | 87630c8cf33105cc8c000e73cb7b67a2decfe02d (diff) | |
use tar to extract .tar.gz
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/utils/archive/extract.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/modules/utils/archive/extract.lua b/xmake/modules/utils/archive/extract.lua index 3bb69ee1a..6736b6f9e 100644 --- a/xmake/modules/utils/archive/extract.lua +++ b/xmake/modules/utils/archive/extract.lua @@ -39,8 +39,9 @@ end -- extract archivefile using tar function _extract_using_tar(archivefile, outputdir, extension, opt) - -- the tar of windows can only extract "*.tar" - if os.host() == "windows" and extension ~= ".tar" then + -- the tar on windows can only extract "*.tar", "*.tar.gz" + -- the tar on msys2 can extract more, like "*.tar.bz2", .. + if os.host() == "windows" and (extension ~= ".tar" or extension == ".tar.gz") then return false end @@ -425,7 +426,8 @@ function main(archivefile, outputdir, opt) , [".tgz"] = {_extract_using_7z, _extract_using_tar} , [".bz2"] = {_extract_using_7z, _extract_using_bzip2} , [".tar"] = {_extract_using_7z, _extract_using_tar} - , [".tar.gz"] = {_extract_using_7z, _extract_using_gzip} + -- @see https://github.com/xmake-io/xmake/issues/5538 + , [".tar.gz"] = {_extract_using_tar, _extract_using_7z, _extract_using_gzip} , [".tar.xz"] = {_extract_using_7z, _extract_using_xz} , [".tar.bz2"] = {_extract_using_7z, _extract_using_bzip2} , [".tar.lz"] = {_extract_using_7z} |
