diff options
Diffstat (limited to 'xmake/core')
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/package/repository.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/xmake/core/sandbox/modules/import/core/package/repository.lua b/xmake/core/sandbox/modules/import/core/package/repository.lua index 17ff95b4c..f4269bb9e 100644 --- a/xmake/core/sandbox/modules/import/core/package/repository.lua +++ b/xmake/core/sandbox/modules/import/core/package/repository.lua @@ -60,7 +60,13 @@ function sandbox_core_package_repository.clear(is_global) end -- get all repositories from global or local directory -function sandbox_core_package_repository.repositories(is_global) +-- +-- opt: +-- - global = true: load global repositories +-- - network = false: do not access network resources (skip fasturl sorting) +function sandbox_core_package_repository.repositories(opt) + opt = opt or {} + local is_global = opt.global -- load repositories from repository cache local repositories = {} @@ -113,6 +119,9 @@ function sandbox_core_package_repository.repositories(is_global) if network == nil then network = global.get("network") end + if opt.network == false then + network = "private" + end -- add artifacts urls (only on Windows) if os.is_host("windows") then @@ -184,4 +193,3 @@ end -- return module return sandbox_core_package_repository - |
