summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
authorruki <[email protected]>2026-08-15 19:26:52 +0800
committerruki <[email protected]>2026-08-15 19:26:52 +0800
commit65854acd5e7080dae4cac3e3b3ec1ce01e902ae7 (patch)
tree5f32e58a6fffc615927833e2e15b077a35ae1e5f /xmake/core
parent4c7c17c10f8a4270b27d90958544ce2886dc6052 (diff)
fix upgrade addon
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/package/addon.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/xmake/core/package/addon.lua b/xmake/core/package/addon.lua
index 71af9aceb..6e7d62eb4 100644
--- a/xmake/core/package/addon.lua
+++ b/xmake/core/package/addon.lua
@@ -496,9 +496,24 @@ end
-- @return the addons table, e.g. {["hello-world"] = {version = "latest", payloads = {"plugins"}}}
--
function addon.addons(opt)
- if opt and opt.force then
+ opt = opt or {}
+ if opt.force then
addon._registry({force = true})
end
+
+ -- get the really installed versions instead of the pinned ones? e.g. locking them
+ -- @note we do not cache it, the cache is the pinned view of this project
+ if opt.unpinned then
+ local addons = {}
+ for dirname, addoninfo in pairs(addon._registry()) do
+ local versioninfo = addoninfo.versions and addoninfo.versions[addoninfo.active]
+ if versioninfo then
+ addons[dirname] = versioninfo
+ end
+ end
+ return addons
+ end
+
local addons = addon._ADDONS
if addons == nil then
addons = {}