diff options
| author | ruki <[email protected]> | 2021-02-21 19:12:01 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-02-21 19:12:01 +0800 |
| commit | e53e7a33d47b36ddff4b6ec1ed2a64413760ead6 (patch) | |
| tree | 4fd1c7525a702813d5bcd074d20703b76d7b76a6 /xmake/modules/private/action/require/impl/package.lua | |
| parent | 3de14fa6738d4cb9f2bf5b0fc6e635776f82d407 (diff) | |
move should_install script
Diffstat (limited to 'xmake/modules/private/action/require/impl/package.lua')
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index abfa91e7b..f31400625 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -578,6 +578,23 @@ function _load_package(packagename, requireinfo, opt) return package end +-- this package should be install? +function should_install(package) + if package:exists() 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 + if _should_install(parent) and not parent:exists() then + return true + end + end + else + return true + end +end + -- load all required packages function _load_packages(requires, opt) |
