aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/justfile
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-04-21 01:23:21 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-04-21 01:23:21 +0100
commit1e2576f15a21d0144df2ab16ab7f61f496167140 (patch)
treec272aa50891cf1c20b15985e5e14f834bbbdff3b /justfile
parent3604e98c65fe1755534dee70285b95295a6d56da (diff)
downloaddotfiles-1e2576f15a21d0144df2ab16ab7f61f496167140.tar.gz
dotfiles-1e2576f15a21d0144df2ab16ab7f61f496167140.tar.bz2
dotfiles-1e2576f15a21d0144df2ab16ab7f61f496167140.zip
refactor: 'just status' only reports missing for groups ≥50% installed
Unadopted groups (e.g. gaming, nvidia on non-gaming/non-nvidia machines) no longer spam 'missing:' lines. Undeclared detection is unchanged — any installed package not in any list is still reported.
Diffstat (limited to 'justfile')
-rw-r--r--justfile21
1 files changed, 18 insertions, 3 deletions
diff --git a/justfile b/justfile
index 1de60e4..2a91239 100644
--- a/justfile
+++ b/justfile
@@ -52,12 +52,27 @@ add group pkg:
fi
paru -S --needed '{{ pkg }}'
-# Show package and dotfile drift
+# Show package and dotfile drift (only for groups ≥50% installed)
status:
#!/bin/sh
- echo "=== Package drift ==="
+ active_file=$(mktemp)
+ trap 'rm -f "$active_file"' EXIT
+ for file in meta/*.txt; do
+ pkgs=$(grep -v '^\s*#' "$file" | grep -v '^\s*$')
+ total=$(echo "$pkgs" | wc -l)
+ installed=0
+ for pkg in $pkgs; do
+ pacman -Qi "$pkg" >/dev/null 2>&1 && installed=$((installed + 1))
+ done
+ if [ $((installed * 2)) -ge "$total" ]; then
+ echo "$pkgs" >> "$active_file"
+ fi
+ done
+ active=$(sort -u "$active_file")
declared=$(cat meta/*.txt | grep -v '^\s*#' | grep -v '^\s*$' | sort -u)
- echo "$declared" | while read -r pkg; do
+ echo "=== Package drift ==="
+ echo "$active" | while read -r pkg; do
+ [ -z "$pkg" ] && continue
pacman -Qi "$pkg" >/dev/null 2>&1 || echo " missing: $pkg"
done
pacman -Qqe | while read -r pkg; do