Skip to content

Commit 2d69c10

Browse files
authored
Merge pull request #6822 from Shiffted/fix_repo_cache
Prioritize envs over repo cache
2 parents d605ad1 + 1cdf616 commit 2d69c10

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

xmake/core/sandbox/modules/import/core/package/repository.lua

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ function sandbox_core_package_repository.repositories(is_global)
114114
end
115115

116116
-- add artifacts urls
117-
local artifacts_urls = localcache.cache("repository"):get("artifacts_urls")
118-
if not artifacts_urls then
119-
local binary_repo = os.getenv("XMAKE_BINARY_REPO")
120-
if binary_repo then
121-
artifacts_urls = {binary_repo}
122-
else
117+
local artifacts_urls = os.getenv("XMAKE_BINARY_REPO")
118+
if artifacts_urls then
119+
artifacts_urls = {artifacts_urls}
120+
else
121+
artifacts_urls = localcache.cache("repository"):get("artifacts_urls")
122+
if not artifacts_urls then
123123
artifacts_urls = {"https://github.com/xmake-mirror/build-artifacts.git",
124124
"https://gitlab.com/xmake-mirror/build-artifacts.git",
125125
"https://gitee.com/xmake-mirror/build-artifacts.git"}
@@ -140,12 +140,12 @@ function sandbox_core_package_repository.repositories(is_global)
140140
end
141141

142142
-- add main urls
143-
local mainurls = localcache.cache("repository"):get("mainurls")
144-
if not mainurls then
145-
local mainrepo = os.getenv("XMAKE_MAIN_REPO")
146-
if mainrepo then
147-
mainurls = {mainrepo}
148-
else
143+
local mainurls = os.getenv("XMAKE_MAIN_REPO")
144+
if mainurls then
145+
mainurls = {mainurls}
146+
else
147+
mainurls = localcache.cache("repository"):get("mainurls")
148+
if not mainurls then
149149
mainurls = {"https://github.com/xmake-io/xmake-repo.git",
150150
"https://gitlab.com/tboox/xmake-repo.git",
151151
"https://gitee.com/tboox/xmake-repo.git"}

0 commit comments

Comments
 (0)