diff options
| author | ruki <[email protected]> | 2022-05-28 23:07:44 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-05-28 23:07:44 +0800 |
| commit | 5d70ef54c67908120159570254d2c194bb6c6f75 (patch) | |
| tree | ef8b0e9d50a5435d5b2e0f653ae8619452062605 /xmake/core/package/package.lua | |
| parent | 5eeeca1a1b2f3a0ca5b4a7e5372398cb758af43f (diff) | |
add package policy
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 6862d320b..7126a2619 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -485,6 +485,10 @@ end -- is fetch only? function _instance:is_fetchonly() + local project = package._project() + if project and project.policy("package.fetch_only") then + return true + end return self:get("fetch") and not self:get("install") end @@ -1466,6 +1470,12 @@ function _instance:fetch(opt) return fetchinfo end + -- install only? + local project = package._project() + if project and project.policy("package.install_only") then + return + end + -- fetch the require version local require_ver = opt.version or self:requireinfo().version if not self:is_thirdparty() and not require_ver:find('.', 1, true) then |
