diff options
| author | ruki <[email protected]> | 2024-08-30 00:55:04 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-08-30 00:55:04 +0800 |
| commit | ed50eae6d3d30d0071e612aec6d9c446b578b0d3 (patch) | |
| tree | cdce6089418d295499e564cd49ed120ef02c52e6 | |
| parent | 2be67f301013b092c299f4d3c0fe61bd6d690f92 (diff) | |
improve tar
| -rw-r--r-- | xmake/modules/utils/archive/extract.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/xmake/modules/utils/archive/extract.lua b/xmake/modules/utils/archive/extract.lua index 6736b6f9e..c77ffc1ac 100644 --- a/xmake/modules/utils/archive/extract.lua +++ b/xmake/modules/utils/archive/extract.lua @@ -41,7 +41,7 @@ function _extract_using_tar(archivefile, outputdir, extension, opt) -- 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 + if os.host() == "windows" and (extension ~= ".tar" and extension ~= ".tar.gz") then return false end @@ -69,8 +69,12 @@ function _extract_using_tar(archivefile, outputdir, extension, opt) table.insert(argv, "--force-local") end end - table.insert(argv, "-xf") - table.insert(argv, archivefile) + if option.get("verbose") then + table.insert(argv, "-xvf") + else + table.insert(argv, "-xf") + end + table.insert(argv, path.absolute(archivefile)) -- ensure output directory if not os.isdir(outputdir) then @@ -97,6 +101,7 @@ function _extract_using_tar(archivefile, outputdir, extension, opt) else os.vrunv(program, argv) end + return true end @@ -460,3 +465,4 @@ function main(archivefile, outputdir, opt) -- extract it return _extract(archivefile, outputdir, extension, extractors[extension], opt) end + |
