diff options
| author | ruki <[email protected]> | 2024-05-08 23:58:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-05-08 23:58:38 +0800 |
| commit | ac710f9f2e51bab6d7cb2c8f853944a02505c3bc (patch) | |
| tree | 144fc9cee3ad833366c69f30d839c3cdef184838 | |
| parent | ffd93fb0daccc2d4e88c1984440cb05ab96f5adb (diff) | |
do not extract package
3 files changed, 14 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 060f7303b..203f0c5b8 100644 --- a/xmake/modules/private/action/require/impl/actions/download.lua +++ b/xmake/modules/private/action/require/impl/actions/download.lua @@ -207,6 +207,11 @@ function _download(package, url, sourcedir, opt) end end + -- we do not extract it + if opt.extract == false then + return + end + -- extract package file local sourcedir_tmp = sourcedir .. ".tmp" os.rm(sourcedir_tmp) @@ -280,10 +285,11 @@ function _urls(package) end -- download the given package -function main(package) +function main(package, opt) + opt = opt or {} -- get working directory of this package - local workdir = package:cachedir() + local workdir = opt.outputdir or package:cachedir() -- ensure the working directory first os.mkdir(workdir) @@ -334,6 +340,7 @@ function main(package) local script = package:script("download") if script then _download_from_script(package, script, { + extract = opt.extract, sourcedir = sourcedir, url = url, url_alias = url_alias, @@ -345,6 +352,7 @@ function main(package) url_submodules = url_submodules}) else _download(package, url, sourcedir, { + extract = opt.extract, url_alias = url_alias, url_excludes = url_excludes, url_http_headers = url_http_headers}) diff --git a/xmake/modules/private/action/require/impl/download_packages.lua b/xmake/modules/private/action/require/impl/download_packages.lua index 5005391c4..3f37ddcaf 100644 --- a/xmake/modules/private/action/require/impl/download_packages.lua +++ b/xmake/modules/private/action/require/impl/download_packages.lua @@ -175,7 +175,7 @@ function _download_packages(packages_download, packagedeps) packages_downloading[index] = instance -- download this package - action_download(instance) + action_download(instance, {outputdir = option.get("packagedir"), extract = false}) -- reset package status cache _g.package_status_cache = nil diff --git a/xmake/modules/private/xrepo/action/download.lua b/xmake/modules/private/xrepo/action/download.lua index 957aa9e16..aa318dd3f 100644 --- a/xmake/modules/private/xrepo/action/download.lua +++ b/xmake/modules/private/xrepo/action/download.lua @@ -174,6 +174,9 @@ function _download_packages(packages) end local outputdir = option.get("outputdir") if outputdir then + if not path.is_absolute(outputdir) then + outputdir = path.absolute(outputdir, os.workingdir()) + end table.insert(require_argv, "--packagedir=" .. outputdir) end local extra = {system = false} |
