From 5559d30a41da6b7e7a305cb7c239776ea646bbd7 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 27 Jul 2022 00:29:13 +0800 Subject: add pkg_cachedir --- xmake/actions/global/xmake.lua | 1 + xmake/core/package/package.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/xmake/actions/global/xmake.lua b/xmake/actions/global/xmake.lua index 224bf06fd..ab8fa1366 100644 --- a/xmake/actions/global/xmake.lua +++ b/xmake/actions/global/xmake.lua @@ -76,6 +76,7 @@ task("global") {nil, "pkg_searchdirs", "kv", nil , "The search directories of the remote package." , " e.g." , " - xmake g --pkg_searchdirs=/dir1" .. path.envsep() .. "/dir2"}, + {nil, "pkg_cachedir", "kv", nil , "The cache root directory of the remote package."}, {nil, "pkg_installdir", "kv", nil , "The install root directory of the remote package."}, -- show platform menu options diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 08a6846a7..94dd88b61 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -2054,7 +2054,7 @@ function package.cachedir(opt) opt = opt or {} local cachedir = package._CACHEDIR if not cachedir then - cachedir = os.getenv("XMAKE_PKG_CACHEDIR") or path.join(global.cachedir(), "packages") + cachedir = os.getenv("XMAKE_PKG_CACHEDIR") or global.get("pkg_cachedir") or path.join(global.cachedir(), "packages") package._CACHEDIR = cachedir end if opt.rootonly then -- cgit v1.3.1