diff options
| author | ruki <[email protected]> | 2021-03-01 23:36:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-03-01 23:36:22 +0800 |
| commit | cbaf212c6befb4e8974aa49be12a99a9fe316f46 (patch) | |
| tree | b32c45a9e145639f20030078ceb48080a8acdd8c | |
| parent | 5aae64879a8c1ed79921a671453c27d3342ec2eb (diff) | |
improve extract
3 files changed, 6 insertions, 3 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/download.lua b/xmake/modules/private/action/require/impl/actions/download.lua index 620ba67ec..3d27f6736 100644 --- a/xmake/modules/private/action/require/impl/actions/download.lua +++ b/xmake/modules/private/action/require/impl/actions/download.lua @@ -137,6 +137,7 @@ function _download(package, url, sourcedir, url_alias, url_excludes) -- create an empty source directory if do not extract package file os.tryrm(sourcedir) os.mkdir(sourcedir) + raise("cannot extract %s", packagefile) end -- save original file path diff --git a/xmake/modules/private/action/require/impl/actions/download_resources.lua b/xmake/modules/private/action/require/impl/actions/download_resources.lua index 6447b3ea2..9c40b0b81 100644 --- a/xmake/modules/private/action/require/impl/actions/download_resources.lua +++ b/xmake/modules/private/action/require/impl/actions/download_resources.lua @@ -75,6 +75,7 @@ function _download(package, resource_name, resource_url, resource_hash) os.mv(resourcedir_tmp, resourcedir) else os.tryrm(resourcedir_tmp) + raise("cannot extract %s", resource_file) end end diff --git a/xmake/modules/utils/archive/extract.lua b/xmake/modules/utils/archive/extract.lua index 74b8e1fdf..d94d67cc5 100644 --- a/xmake/modules/utils/archive/extract.lua +++ b/xmake/modules/utils/archive/extract.lua @@ -355,9 +355,10 @@ function main(archivefile, outputdir, opt) , [".tgz"] = {_extract_using_7z, _extract_using_tar} , [".bz2"] = {_extract_using_7z, _extract_using_tar} , [".tar"] = {_extract_using_7z, _extract_using_tar} - , [".tar.gz"] = {_extract_using_7z, _extract_using_tar, _extract_using_gzip} - , [".tar.xz"] = {_extract_using_7z, _extract_using_tar, _extract_using_xz} - , [".tar.bz2"] = {_extract_using_7z, _extract_using_tar} + -- tar/windows can not extract .tar.bz2 ... + , [".tar.gz"] = {_extract_using_7z, _extract_using_gzip} + , [".tar.xz"] = {_extract_using_7z, _extract_using_xz} + , [".tar.bz2"] = {_extract_using_7z} } else extractors = |
