summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-09-06 00:50:38 +0800
committerruki <[email protected]>2022-09-06 00:50:38 +0800
commit10d142571fc619051f83d116393ab86a29fcaee2 (patch)
treea62c2977ced78cd28cc2b96f44339fb940b35a6d
parent2a8af8db1d8b6e05f2a751a3320a1c45596ac0e5 (diff)
force to reinstall package
-rw-r--r--xmake/modules/private/action/require/impl/actions/install.lua3
-rw-r--r--xmake/modules/private/action/require/impl/package.lua3
2 files changed, 5 insertions, 1 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/install.lua b/xmake/modules/private/action/require/impl/actions/install.lua
index 29725e973..2a422795f 100644
--- a/xmake/modules/private/action/require/impl/actions/install.lua
+++ b/xmake/modules/private/action/require/impl/actions/install.lua
@@ -274,7 +274,8 @@ function main(package)
else
-- build and install package to the install directory
- if option.get("force") or not package:manifest_load() then
+ local force_reinstall = package:data("force_reinstall") or option.get("force")
+ if force_reinstall or not package:manifest_load() then
-- clean install directory first
os.tryrm(package:installdir())
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index 46bc16fed..a506a66c0 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -1018,6 +1018,9 @@ function _compatible_with_previous_linkdeps(package, opt)
if not is_compatible and #compatible_tips > 0 then
package:data_set("linkdeps.compatible_tips", compatible_tips)
end
+ if not is_compatible then
+ package:data_set("force_reinstall", true)
+ end
return is_compatible
end