summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-22 00:59:41 +0800
committerruki <[email protected]>2020-12-22 00:59:41 +0800
commitfd125f21ece875cd6a5037725f2d84f24e658f41 (patch)
tree590e39b3b4bdb4f3853b0a965c6367b0ed646b12
parentf3897d3c4f307335806c64060e679324f0931adc (diff)
improve some detectcache
-rw-r--r--xmake/actions/require/impl/package.lua6
-rw-r--r--xmake/modules/net/ping.lua7
2 files changed, 7 insertions, 6 deletions
diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua
index b4bb5e069..c66f1807a 100644
--- a/xmake/actions/require/impl/package.lua
+++ b/xmake/actions/require/impl/package.lua
@@ -27,7 +27,7 @@ import("core.base.scheduler")
import("core.base.tty")
import("private.async.runjobs")
import("private.utils.progress")
-import("lib.detect.cache", {alias = "detectcache"})
+import("core.cache.localcache")
import("core.project.project")
import("core.package.package", {alias = "core_package"})
import("actions.install", {alias = "action_install"})
@@ -838,8 +838,8 @@ function uninstall_packages(requires, opt)
-- do not remove dependent packages
opt.nodeps = true
- -- clear the detect cache
- detectcache.clear()
+ -- clear the local cache
+ localcache.clear()
-- remove all packages
local packages = {}
diff --git a/xmake/modules/net/ping.lua b/xmake/modules/net/ping.lua
index a783866fc..1f361a5d6 100644
--- a/xmake/modules/net/ping.lua
+++ b/xmake/modules/net/ping.lua
@@ -19,7 +19,7 @@
--
-- imports
-import("lib.detect.cache")
+import("core.cache.detectcache")
import("detect.tools.find_ping")
import("detect.tools.find_nmap")
import("private.async.runjobs")
@@ -45,7 +45,7 @@ function main(hosts, opt)
-- do not force ping? enable cache
local cacheinfo = nil
if not opt.force then
- cacheinfo = cache.load("net.ping")
+ cacheinfo = detectcache:get("net.ping")
end
-- run tasks
@@ -111,7 +111,8 @@ function main(hosts, opt)
-- save cache
if cacheinfo then
- cache.save("net.ping", cacheinfo)
+ detectcache:set("net.ping", cacheinfo)
+ detectcache:save()
end
-- ok?