summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/private/action/require/impl/actions/install.lua3
-rw-r--r--xmake/modules/private/action/require/impl/utils/filter.lua4
2 files changed, 4 insertions, 3 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/install.lua b/xmake/modules/private/action/require/impl/actions/install.lua
index 57511a930..c059a6e86 100644
--- a/xmake/modules/private/action/require/impl/actions/install.lua
+++ b/xmake/modules/private/action/require/impl/actions/install.lua
@@ -158,6 +158,7 @@ function main(package)
patch_sources(package)
-- enter the environments of all package dependencies
+ local oldenvs = os.getenvs()
for _, dep in ipairs(package:orderdeps()) do
dep:envs_enter()
end
@@ -167,7 +168,7 @@ function main(package)
-- do install
if script ~= nil then
- filter.call(script, package)
+ filter.call(script, package, {oldenvs = oldenvs})
end
-- leave the environments of all package dependencies
diff --git a/xmake/modules/private/action/require/impl/utils/filter.lua b/xmake/modules/private/action/require/impl/utils/filter.lua
index 11bdf70de..75bba1d42 100644
--- a/xmake/modules/private/action/require/impl/utils/filter.lua
+++ b/xmake/modules/private/action/require/impl/utils/filter.lua
@@ -109,7 +109,7 @@ function _handler(package, strval)
end
-- attach filter to the given script and call it
-function call(script, package)
+function call(script, package, opt)
-- get sandbox filter and handlers of the given script
local sandbox_filter = sandbox.filter(script)
@@ -122,7 +122,7 @@ function call(script, package)
sandbox_filter:register("package", _handler(package))
-- call it
- script(package)
+ script(package, opt)
-- restore handlers
sandbox_filter:set_handlers(sandbox_handlers)