diff options
| author | ruki <[email protected]> | 2024-04-10 22:42:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-04-10 22:42:38 +0800 |
| commit | bcc361fcee9277dedfdcdd031d058c4de5322c73 (patch) | |
| tree | ea5e455e50257e5cf5871846596c68dd80ee8995 | |
| parent | 3270e053705de1df51abda4fa56faee6888d9295 (diff) | |
fix archive
| -rw-r--r-- | xmake/modules/private/action/require/impl/actions/download.lua | 1 | ||||
| -rw-r--r-- | xmake/modules/utils/archive/archive.lua | 8 | ||||
| -rw-r--r-- | xmake/modules/utils/archive/extract.lua | 8 |
3 files changed, 4 insertions, 13 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/download.lua b/xmake/modules/private/action/require/impl/actions/download.lua index c90fc4646..060f7303b 100644 --- a/xmake/modules/private/action/require/impl/actions/download.lua +++ b/xmake/modules/private/action/require/impl/actions/download.lua @@ -211,7 +211,6 @@ function _download(package, url, sourcedir, opt) local sourcedir_tmp = sourcedir .. ".tmp" os.rm(sourcedir_tmp) local extension = archive.extension(packagefile) - local ok = try {function() archive.extract(packagefile, sourcedir_tmp, {excludes = opt.url_excludes}); return true end} if ok then -- move to source directory and we skip it to avoid long path issues on windows if only one root directory diff --git a/xmake/modules/utils/archive/archive.lua b/xmake/modules/utils/archive/archive.lua index 59933ae68..f91aa9d7f 100644 --- a/xmake/modules/utils/archive/archive.lua +++ b/xmake/modules/utils/archive/archive.lua @@ -296,7 +296,7 @@ function _archive(archivefile, inputfiles, extension, archivers, opt) } } if ok then - return + return true end end raise("cannot archive %s, %s!", path.filename(archivefile), errors or "archivers not found!") @@ -319,12 +319,8 @@ end -- @param options the options, e.g.. {curdir = "/tmp", recurse = true, compress = "fastest|faster|default|better|best", excludes = {"*/dir/*", "dir/*"}} -- function main(archivefile, inputfiles, opt) - - -- init inputfiles - inputfiles = inputfiles or os.curdir() - - -- init options opt = opt or {} + inputfiles = inputfiles or os.curdir() if opt.recurse == nil then opt.recurse = true end diff --git a/xmake/modules/utils/archive/extract.lua b/xmake/modules/utils/archive/extract.lua index b046dafd4..604899300 100644 --- a/xmake/modules/utils/archive/extract.lua +++ b/xmake/modules/utils/archive/extract.lua @@ -388,7 +388,7 @@ function _extract(archivefile, outputdir, extension, extractors, opt) } } if ok then - return + return true end end raise("cannot extract %s, %s!", path.filename(archivefile), errors or "extractors not found!") @@ -401,12 +401,8 @@ end -- @param options the options, e.g.. {excludes = {"*/dir/*", "dir/*"}} -- function main(archivefile, outputdir, opt) - - -- init outputdir - outputdir = outputdir or os.curdir() - - -- init options opt = opt or {} + outputdir = outputdir or os.curdir() -- init extractors local extractors |
