From ffe2039de5556dd6fb9096552e7d2b5ad1669b70 Mon Sep 17 00:00:00 2001 From: Daniele Fucini Date: Sat, 24 Oct 2026 22:17:23 +0200 Subject: [PATCH] Clean downloaded sources from AUR clones after aurs After a successful sync, aurb runs git clean -fx in each clone under the aurutils sync folder, removing downloaded sources and build logs while keeping tracked files and VCS source folders. --- .local/bin/aurb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.local/bin/aurb b/.local/bin/aurb index 6efb036..c881ba0 100755 --- a/.local/bin/aurb +++ b/.local/bin/aurb @@ -31,3 +31,13 @@ aur "$cmd" \ --bind-rw "$THINLTO_HOST_DIR" \ --bind "$HOME/.config/aurb" \ "${args[@]}" +status=$? + +# After a successful sync, drop downloaded sources and logs from the AUR clones. Without -d, +# git clean keeps untracked directories, so VCS sources (bare clones) survive. +if [[ $cmd == sync && $status -eq 0 ]]; then + for clone in "${AURDEST:-${XDG_CACHE_HOME:-$HOME/.cache}/aurutils/sync}"/*/; do + [[ -d $clone.git ]] && git -C "$clone" clean -fxq + done +fi +exit "$status"