summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/package/addon.lua7
-rw-r--r--xmake/core/project/project.lua7
-rw-r--r--xmake/core/sandbox/modules/import/core/package/addon.lua2
3 files changed, 5 insertions, 11 deletions
diff --git a/xmake/core/package/addon.lua b/xmake/core/package/addon.lua
index 33eb22e03..731c673ab 100644
--- a/xmake/core/package/addon.lua
+++ b/xmake/core/package/addon.lua
@@ -76,7 +76,7 @@ function addon._save(registry)
addon._ADDONS = nil
local registryfile = addon._registryfile()
-- we need not create an empty registry file if no addons are installed
- if next(registry) == nil and not os.isfile(registryfile) then
+ if table.empty(registry) and not os.isfile(registryfile) then
return
end
local ok, errors = io.save(registryfile, registry)
@@ -211,9 +211,10 @@ function addon._unregister(name, version)
if version then
entry.versions[version] = nil
if entry.active == version then
- entry.active = next(entry.versions)
+ -- we need to select the other one deterministically
+ entry.active = addon.versions(name)[1]
end
- if next(entry.versions) == nil then
+ if table.empty(entry.versions) then
registry[dirname] = nil
end
else
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index 831f882d4..5c2a12e00 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -259,9 +259,6 @@ end
-- do install the addons which this project declares
function project._do_install_addons()
- if os.getenv("XMAKE_SKIP_ADDONS") then
- return true
- end
-- this project declares nothing?
local addonsinfo, errors = addons.load()
@@ -297,9 +294,7 @@ function project._do_install_addons()
end
table.insert(argv, "private.action.addon.impl.install_addons")
table.insert(argv, os.projectdir())
- local envs = os.getenvs()
- envs.XMAKE_SKIP_ADDONS = "y"
- local ok, errors = os.execv(os.programfile(), argv, {curdir = os.tmpdir(), envs = envs})
+ local ok, errors = os.execv(os.programfile(), argv, {curdir = os.tmpdir()})
if ok ~= 0 then
return false, errors or "install the addons of this project failed!"
end
diff --git a/xmake/core/sandbox/modules/import/core/package/addon.lua b/xmake/core/sandbox/modules/import/core/package/addon.lua
index 89cd60866..dc4740c2e 100644
--- a/xmake/core/sandbox/modules/import/core/package/addon.lua
+++ b/xmake/core/sandbox/modules/import/core/package/addon.lua
@@ -36,8 +36,6 @@ sandbox_core_package_addon.payloads_of = addon.payloads_of
sandbox_core_package_addon.payloadroot = addon.payloadroot
sandbox_core_package_addon.addons = addon.addons
sandbox_core_package_addon.versions = addon.versions
-sandbox_core_package_addon._registry = addon._registry
-sandbox_core_package_addon._registryfile = addon._registryfile
sandbox_core_package_addon.pin = addon.pin
sandbox_core_package_addon.addondir = addon.addondir
sandbox_core_package_addon.rescan = addon.rescan