diff options
| author | ruki <[email protected]> | 2025-12-03 00:35:32 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-12-03 00:35:32 +0800 |
| commit | 32ab2513cedfb907b7397dc571b45d36a366c1c2 (patch) | |
| tree | 9f2768e89a77037f9677b3386c19a96e1465cc04 | |
| parent | 3678276b992b3c790feff7bb0b5ee3a8bdc751b0 (diff) | |
only pull build-artifacts on windows
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/package/repository.lua | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/xmake/core/sandbox/modules/import/core/package/repository.lua b/xmake/core/sandbox/modules/import/core/package/repository.lua index 73b56a231..91c05982e 100644 --- a/xmake/core/sandbox/modules/import/core/package/repository.lua +++ b/xmake/core/sandbox/modules/import/core/package/repository.lua @@ -26,6 +26,7 @@ local global = require("base/global") local project = require("project/project") local localcache = require("cache/localcache") local repository = require("package/repository") +local os = require("base/os") local raise = require("sandbox/modules/raise") local import = require("sandbox/modules/import") @@ -113,29 +114,31 @@ function sandbox_core_package_repository.repositories(is_global) network = global.get("network") end - -- add artifacts urls - local artifacts_urls = os.getenv("XMAKE_BINARY_REPO") - if artifacts_urls then - artifacts_urls = {artifacts_urls} - else - artifacts_urls = localcache.cache("repository"):get("artifacts_urls") - if not artifacts_urls then - artifacts_urls = {"https://github.com/xmake-mirror/build-artifacts.git", - "https://gitlab.com/xmake-mirror/build-artifacts.git", - "https://gitee.com/xmake-mirror/build-artifacts.git"} - if network ~= "private" then - import("net.fasturl") - fasturl.add(artifacts_urls) - artifacts_urls = fasturl.sort(artifacts_urls) - localcache.cache("repository"):set("artifacts_urls", artifacts_urls) - localcache.cache("repository"):save() + -- add artifacts urls (only on Windows) + if os.is_host("windows") then + local artifacts_urls = os.getenv("XMAKE_BINARY_REPO") + if artifacts_urls then + artifacts_urls = {artifacts_urls} + else + artifacts_urls = localcache.cache("repository"):get("artifacts_urls") + if not artifacts_urls then + artifacts_urls = {"https://github.com/xmake-mirror/build-artifacts.git", + "https://gitlab.com/xmake-mirror/build-artifacts.git", + "https://gitee.com/xmake-mirror/build-artifacts.git"} + if network ~= "private" then + import("net.fasturl") + fasturl.add(artifacts_urls) + artifacts_urls = fasturl.sort(artifacts_urls) + localcache.cache("repository"):set("artifacts_urls", artifacts_urls) + localcache.cache("repository"):save() + end end end - end - if #artifacts_urls > 0 then - local repo = repository.load("build-artifacts", artifacts_urls[1], "main", true) - if repo then - table.insert(repositories, repo) + if #artifacts_urls > 0 then + local repo = repository.load("build-artifacts", artifacts_urls[1], "main", true) + if repo then + table.insert(repositories, repo) + end end end |
