diff options
| author | ruki <[email protected]> | 2020-10-24 20:29:03 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-10-24 20:29:03 +0800 |
| commit | e35442b19096ec0de49ae8023d1aa475e420a7b0 (patch) | |
| tree | 0bab70c02965af469952e4903248c44224e172aa | |
| parent | fbe8fb9653040630b9e340e2dda44e80bcc0166d (diff) | |
fix repo order
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/package/repository.lua | 42 |
1 files changed, 21 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 8a5ac8fa3..e508cd03e 100644 --- a/xmake/core/sandbox/modules/import/core/package/repository.lua +++ b/xmake/core/sandbox/modules/import/core/package/repository.lua @@ -71,28 +71,8 @@ end -- get all repositories from global or local directory function sandbox_core_package_repository.repositories(is_global) - -- add main global xmake repository - local repositories = {} - if is_global and global.get("network") ~= "private" then - - -- import fasturl - import("net.fasturl") - - -- sort main urls - local mainurls = {"https://github.com/xmake-io/xmake-repo.git", "https://gitlab.com/tboox/xmake-repo.git", "https://gitee.com/tboox/xmake-repo.git"} - fasturl.add(mainurls) - mainurls = fasturl.sort(mainurls) - - -- add main url - if #mainurls > 0 then - local repo = repository.load("xmake-repo", mainurls[1], "master", true) - if repo then - table.insert(repositories, repo) - end - end - end - -- load repositories from repository cache + local repositories = {} for name, repoinfo in pairs(table.wrap(repository.repositories(is_global))) do local url = repoinfo local branch = nil @@ -126,6 +106,26 @@ function sandbox_core_package_repository.repositories(is_global) end end + -- add main global xmake repository + if is_global and global.get("network") ~= "private" then + + -- import fasturl + import("net.fasturl") + + -- sort main urls + local mainurls = {"https://github.com/xmake-io/xmake-repo.git", "https://gitlab.com/tboox/xmake-repo.git", "https://gitee.com/tboox/xmake-repo.git"} + fasturl.add(mainurls) + mainurls = fasturl.sort(mainurls) + + -- add main url + if #mainurls > 0 then + local repo = repository.load("xmake-repo", mainurls[1], "master", true) + if repo then + table.insert(repositories, repo) + end + end + end + -- load repository from builtin program directory if is_global then local repo = repository.load("builtin-repo", path.join(os.programdir(), "repository"), nil, true) |
