summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-01-28 22:42:04 +0800
committerruki <[email protected]>2019-01-28 10:12:26 +0800
commit93c79d79a4ba9febfd231a28632f7a6b8b46e84b (patch)
tree5965546a0910b95e8b2d042b81521b37a59628ff
parentef61b0b1808551f90ab7b6d09d91c97bcfeb24d0 (diff)
fix load system package
-rw-r--r--xmake/core/package/package.lua2
-rw-r--r--xmake/core/sandbox/modules/import/core/sandbox/module.lua3
-rw-r--r--xmake/modules/package/manager/conan/install_package.lua6
3 files changed, 8 insertions, 3 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 30aa9f698..f9b935cd6 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -820,7 +820,7 @@ function package.load_from_system(packagename)
end
-- make sandbox instance with the given script
- local instance, errors = sandbox.new(on_install, interp:filter(), interp:rootdir())
+ local instance, errors = sandbox.new(on_install, interp:filter())
if not instance then
return nil, errors
end
diff --git a/xmake/core/sandbox/modules/import/core/sandbox/module.lua b/xmake/core/sandbox/modules/import/core/sandbox/module.lua
index 35a6e5df8..96c115ac8 100644
--- a/xmake/core/sandbox/modules/import/core/sandbox/module.lua
+++ b/xmake/core/sandbox/modules/import/core/sandbox/module.lua
@@ -392,10 +392,9 @@ function core_sandbox_module.import(name, opt)
-- the root directory for this sandbox script
local rootdir = opt.rootdir or instance:rootdir()
- assert(rootdir)
-- init module directories (disable local packages?)
- local modules_directories = opt.nolocal and core_sandbox_module.directories() or table.join(rootdir, core_sandbox_module.directories())
+ local modules_directories = (opt.nolocal or not rootdir) and core_sandbox_module.directories() or table.join(rootdir, core_sandbox_module.directories())
-- load module
local found, module, errors = core_sandbox_module._find_and_load(name, opt, instance, modules, modules_directories)
diff --git a/xmake/modules/package/manager/conan/install_package.lua b/xmake/modules/package/manager/conan/install_package.lua
index 114dd6202..5e609e7d0 100644
--- a/xmake/modules/package/manager/conan/install_package.lua
+++ b/xmake/modules/package/manager/conan/install_package.lua
@@ -76,6 +76,12 @@ function main(name, opt)
-- get build directory
local buildir = _get_build_directory(name)
+ -- clean the build directory
+ os.tryrm(buildir)
+ if not os.isdir(buildir) then
+ os.mkdir(buildir)
+ end
+
-- enter build directory
local oldir = os.cd(buildir)