summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2021-05-22 23:59:41 +0800
committerruki <[email protected]>2021-05-22 23:59:41 +0800
commitbd080f2c7943471935bf5d67b04484bed5ace455 (patch)
treeaae79096718dd38b1767a61fc8ecd4e0855afa98 /xmake/modules
parentfdfa79d46fbaf0f674e343f4939859cbe9bbe40f (diff)
improve config cache
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/private/action/require/impl/actions/download.lua6
-rw-r--r--xmake/modules/private/action/require/impl/actions/download_resources.lua2
2 files changed, 4 insertions, 4 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/download.lua b/xmake/modules/private/action/require/impl/actions/download.lua
index 6af797b5e..03396cd00 100644
--- a/xmake/modules/private/action/require/impl/actions/download.lua
+++ b/xmake/modules/private/action/require/impl/actions/download.lua
@@ -70,13 +70,13 @@ function _checkout(package, url, sourcedir, url_alias)
if package:branch() then
-- only shadow clone this branch
- git.clone(proxy.mirror(url), {depth = 1, recursive = true, longpaths = longpaths, branch = package:branch(), outputdir = packagedir})
+ git.clone(proxy.mirror(url) or url, {depth = 1, recursive = true, longpaths = longpaths, branch = package:branch(), outputdir = packagedir})
-- download package from revision or tag?
else
-- clone whole history and tags
- git.clone(proxy.mirror(url), {longpaths = longpaths, outputdir = packagedir})
+ git.clone(proxy.mirror(url) or url, {longpaths = longpaths, outputdir = packagedir})
-- attempt to checkout the given version
local revision = package:revision(url_alias) or package:tag() or package:version_str()
@@ -137,7 +137,7 @@ function _download(package, url, sourcedir, url_alias, url_excludes)
-- we can use local package from the search directories directly if network is too slow
os.cp(localfile, packagefile)
else
- http.download(proxy.mirror(url), packagefile)
+ http.download(proxy.mirror(url) or url, packagefile)
end
end
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 5a85c7c35..f878b27b8 100644
--- a/xmake/modules/private/action/require/impl/actions/download_resources.lua
+++ b/xmake/modules/private/action/require/impl/actions/download_resources.lua
@@ -56,7 +56,7 @@ function _download(package, resource_name, resource_url, resource_hash)
-- we can use local resource from the search directories directly if network is too slow
os.cp(localfile, resource_file)
elseif resource_url:find(string.ipattern("https-://")) or resource_url:find(string.ipattern("ftps-://")) then
- http.download(proxy.mirror(resource_url), resource_file)
+ http.download(proxy.mirror(resource_url) or resource_url, resource_file)
else
raise("invalid resource url(%s)", resource_url)
end