From 4be6f58a6f5669cd71438907a3fd4d6cb35c7caf Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 13 Apr 2021 00:35:14 +0800 Subject: fix fetch package --- xmake/modules/private/action/require/impl/package.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index a2357f984..72ea3807a 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -69,9 +69,9 @@ end -- - add_requires("zlib~shared", {configs = {shared = true}, alias = "zlib_shared"}) -- -- {system = nil/true/false}: --- nil: get local or system packages +-- nil: get remote or system packages -- true: only get system package --- false: only get local packages +-- false: only get remote packages -- -- function _parse_require(require_str) @@ -614,6 +614,11 @@ function should_install(package) if package:is_fetchonly() then return false end + -- only get system package? e.g. add_requires("xxx", {system = true}) + local requireinfo = package:requireinfo() + if requireinfo and requireinfo.system then + return false + end if package:parents() then -- if all the packages that depend on it already exist, then there is no need to install it for _, parent in pairs(package:parents()) do -- cgit v1.3.1