summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-07-11 21:03:33 +0800
committerruki <[email protected]>2022-07-11 21:03:33 +0800
commitb578ea26614e98a01a86518a2a376f5936d4a7b3 (patch)
tree3a6e48a56ad3fd9e4405feae7c840c6fa0877043
parent3c5afa6aa05090189e9bdf7e679bcae68511c33c (diff)
fix should install
-rw-r--r--xmake/modules/private/action/require/impl/install_packages.lua3
-rw-r--r--xmake/modules/private/action/require/impl/package.lua22
2 files changed, 7 insertions, 18 deletions
diff --git a/xmake/modules/private/action/require/impl/install_packages.lua b/xmake/modules/private/action/require/impl/install_packages.lua
index c2e7f61d7..cc63c462e 100644
--- a/xmake/modules/private/action/require/impl/install_packages.lua
+++ b/xmake/modules/private/action/require/impl/install_packages.lua
@@ -693,9 +693,8 @@ function main(requires, opt)
end
end
- local has_errors = false
-
-- exists unknown packages?
+ local has_errors = false
if #packages_unknown > 0 then
cprint("${bright color.warning}note: ${clear}the following packages were not found in any repository (check if they are spelled correctly):")
for _, instance in ipairs(packages_unknown) do
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index 66b26a602..5c644be1c 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -942,8 +942,13 @@ function _must_depend_on(package, dep)
end
end
+-- the cache directory
+function cachedir()
+ return path.join(global.directory(), "cache", "packages")
+end
+
-- this package should be install?
-function _should_install(package)
+function should_install(package)
if package:is_template() or package:exists() then
return false
end
@@ -982,21 +987,6 @@ function _should_install(package)
end
end
--- the cache directory
-function cachedir()
- return path.join(global.directory(), "cache", "packages")
-end
-
--- this package should be install?
-function should_install(package)
- local result = _memcache():get2("should_install", tostring(package))
- if result == nil then
- result = _should_install(package) or false
- _memcache():set2("should_install", tostring(package), result)
- end
- return result
-end
-
-- get package configs string
function get_configs_str(package)
local configs = {}