From 0e058e82a29f569b1b0402d6860786ab07a094c2 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Fri, 13 Nov 2026 14:35:51 +0100 Subject: [PATCH 1/2] Clear yarn 1's root cache in cleanup_lxc yarn 1 run as root caches under /usr/local/share/.cache/yarn, not in $HOME, so cleanup_lxc left it behind: 1.9 GB after a NocoBase install. --- core/core.func | 3 ++- tests/install-cleanup.sh | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/core.func b/core/core.func index 17f5ffaa..84c104db 100644 --- a/core/core.func +++ b/core/core.func @@ -2490,7 +2490,8 @@ cleanup_lxc() { rm -rf /root/.npm/_cacache /root/.npm/_logs 2>/dev/null || true fi if command -v yarn &>/dev/null; then - rm -rf /root/.cache/yarn /root/.yarn/cache 2>/dev/null || true + # yarn 1 run as root caches under /usr/local/share, not in $HOME (1.9 GB after NocoBase) + rm -rf /root/.cache/yarn /root/.yarn/cache /root/.yarn/berry/cache /usr/local/share/.cache/yarn 2>/dev/null || true fi if command -v pnpm &>/dev/null; then pnpm store prune &>/dev/null || true diff --git a/tests/install-cleanup.sh b/tests/install-cleanup.sh index c19d4dc2..0397c765 100644 --- a/tests/install-cleanup.sh +++ b/tests/install-cleanup.sh @@ -67,5 +67,7 @@ result=$( check "no apt-get: cleanup_lxc cleans through pkg_clean" "pkg_clean" "$result" check "install.func does not shadow core.func's cleanup_lxc" "" "$(grep -n '^cleanup_lxc()' "$CORE_DIR/lxc/install.func" || true)" +check "cleanup_lxc clears yarn 1's root cache" "1" "$(declare -f cleanup_lxc | grep -c '/usr/local/share/.cache/yarn')" + printf '%s passed, %s failed\n' "$passed" "$failed" ((failed == 0)) From ba27c46c03636287425ae0772203dc4f2775eb7e Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Fri, 13 Nov 2026 15:45:47 +0100 Subject: [PATCH 2/2] Trim the comments to what a reader would get wrong --- core/core.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core.func b/core/core.func index 84c104db..f4faa6f5 100644 --- a/core/core.func +++ b/core/core.func @@ -2490,7 +2490,7 @@ cleanup_lxc() { rm -rf /root/.npm/_cacache /root/.npm/_logs 2>/dev/null || true fi if command -v yarn &>/dev/null; then - # yarn 1 run as root caches under /usr/local/share, not in $HOME (1.9 GB after NocoBase) + # yarn 1 run as root caches under /usr/local/share, not in $HOME rm -rf /root/.cache/yarn /root/.yarn/cache /root/.yarn/berry/cache /usr/local/share/.cache/yarn 2>/dev/null || true fi if command -v pnpm &>/dev/null; then