diff options
| author | 2026-04-21 01:23:21 +0100 | |
|---|---|---|
| committer | 2026-04-21 01:23:21 +0100 | |
| commit | 3604e98c65fe1755534dee70285b95295a6d56da (patch) | |
| tree | c5698092c2a6a479d0f50c575a45bfd63c4354e4 | |
| parent | 24a970ca1d545add242a5649c5a7551f942a3e5c (diff) | |
| download | dotfiles-3604e98c65fe1755534dee70285b95295a6d56da.tar.gz dotfiles-3604e98c65fe1755534dee70285b95295a6d56da.tar.bz2 dotfiles-3604e98c65fe1755534dee70285b95295a6d56da.zip | |
refactor: raise 'just fix' threshold from ≥1 to ≥50% installed
Avoids triggering on groups where only a single transitive dep
happens to be installed. Also skips fully-installed groups
(nothing to do).
| -rw-r--r-- | justfile | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -18,19 +18,21 @@ install-all: #!/bin/sh cat meta/*.txt | grep -v '^\s*#' | grep -v '^\s*$' | sort -u | paru -S --needed - -# Fill in missing packages for groups that are already partially/fully installed +# Fill in missing packages for groups that are ≥50% installed fix: #!/bin/sh for file in meta/*.txt; do group=$(basename "$file" .txt) pkgs=$(grep -v '^\s*#' "$file" | grep -v '^\s*$') + total=$(echo "$pkgs" | wc -l) + installed=0 for pkg in $pkgs; do - if pacman -Qi "$pkg" >/dev/null 2>&1; then - echo ">>> topping up $group" - echo "$pkgs" | paru -S --needed - - break - fi + pacman -Qi "$pkg" >/dev/null 2>&1 && installed=$((installed + 1)) done + if [ $((installed * 2)) -ge "$total" ] && [ "$installed" -lt "$total" ]; then + echo ">>> topping up $group ($installed/$total installed)" + echo "$pkgs" | paru -S --needed - + fi done # Add a package to a group and install it (e.g. just add dev ripgrep) |
