summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-06-12 20:54:33 +0800
committerruki <[email protected]>2021-06-12 20:54:33 +0800
commite2c95e2026931b05fe326eb19f95934f1c45bf80 (patch)
treed1a72da9a09713daaacbedc0dc00be22199c3cce
parent074bf08a28929dedeea1d041735ff1bea81ca614 (diff)
add mirror for patching sources
-rw-r--r--xmake/modules/private/action/require/impl/actions/patch_sources.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/patch_sources.lua b/xmake/modules/private/action/require/impl/actions/patch_sources.lua
index 110330af0..d3ca226b1 100644
--- a/xmake/modules/private/action/require/impl/actions/patch_sources.lua
+++ b/xmake/modules/private/action/require/impl/actions/patch_sources.lua
@@ -21,6 +21,7 @@
-- imports
import("core.base.option")
import("net.http")
+import("net.proxy")
import("devel.git")
-- check sha256
@@ -71,7 +72,7 @@ function _patch(package, patch_url, patch_hash)
-- download the patch file
if patch_url:find(string.ipattern("https-://")) or patch_url:find(string.ipattern("ftps-://")) then
- http.download(patch_url, patch_file)
+ http.download(proxy.mirror(patch_url) or patch_url, patch_file)
else
-- copy the patch file
if os.isfile(patch_url) then