diff options
| author | ruki <[email protected]> | 2022-10-10 22:37:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-10-10 22:37:39 +0800 |
| commit | a9e8492bcc68823067d805a7ee666e99c08ad02f (patch) | |
| tree | 9bff8e4f5d3f0a77a4df0eb508584c952a057e89 /xmake/modules | |
| parent | 4eab4583144dd0319c33431a557a06905c811ef5 (diff) | |
add package.install_always policy
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 8 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/install.lua | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index 71f75d418..0608a3960 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -949,9 +949,9 @@ end -- @see https://github.com/xmake-io/xmake/issues/2719 function _compatible_with_previous_librarydeps(package, opt) - -- skip to check compatibility? + -- skip to check compatibility if installation has been finished opt = opt or {} - if opt.check_compatibility == false then + if opt.install_finished then return true end @@ -1036,9 +1036,13 @@ end -- this package should be install? function should_install(package, opt) + opt = opt or {} if package:is_template() then return false end + if not opt.install_finished and package:policy("package.install_always") then + return true + end if package:exists() and _compatible_with_previous_librarydeps(package, opt) then return false end diff --git a/xmake/modules/private/action/require/install.lua b/xmake/modules/private/action/require/install.lua index f6d02717e..ee5e56f95 100644 --- a/xmake/modules/private/action/require/install.lua +++ b/xmake/modules/private/action/require/install.lua @@ -35,7 +35,7 @@ function _check_missing_packages(packages) local packages_missing = {} local optional_missing = {} for _, instance in ipairs(packages) do - if package.should_install(instance, {check_compatibility = false}) or (instance:is_fetchonly() and not instance:exists()) then + if package.should_install(instance, {install_finished = true}) or (instance:is_fetchonly() and not instance:exists()) then if instance:is_optional() then optional_missing[instance:name()] = instance else |
