aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/justfile
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-19 15:16:10 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-19 15:16:10 +0100
commit16ef7641913d2c5e3113308eb330980da100e51e (patch)
tree3e35ffda023a05cd77300e4787faf517547123d5 /justfile
parent4caae06edf4dec9496f7c282684e63bf4519eb4f (diff)
downloaddotfiles-16ef7641913d2c5e3113308eb330980da100e51e.tar.gz
dotfiles-16ef7641913d2c5e3113308eb330980da100e51e.tar.bz2
dotfiles-16ef7641913d2c5e3113308eb330980da100e51e.zip
fix(just): honor IgnorePkg in pkg-apply / pkg-fix
Pacman's IgnorePkg only applies to -Sy{u} upgrade operations; explicit `paru -S <pkg>` bypasses it entirely. `pkg-apply` and `pkg-fix` both pipe the meta/*.txt package lists into `paru -S --needed`, so every sync was reinstalling AUR pins (most painfully llama-cpp-vulkan, a 1-2h rebuild on every llama.cpp commit) whenever the AUR had a newer version, defeating the whole point of pinning. Parse IgnorePkg out of /etc/pacman.conf and strip those names from the list before piping to paru. `pkg-add` is intentionally left unfiltered: explicitly naming a package on the CLI is a deliberate opt-in that should still work for pinned entries. `pkg-update` (which is plain `paru -Syu`) already honors IgnorePkg via pacman itself — no change needed there.
Diffstat (limited to 'justfile')
-rw-r--r--justfile17
1 files changed, 14 insertions, 3 deletions
diff --git a/justfile b/justfile
index bd8a9a2..135d70a 100644
--- a/justfile
+++ b/justfile
@@ -1027,6 +1027,12 @@ pkg-list group="":
pkg-apply *groups:
#!/bin/sh
set -eu
+ # IgnorePkg in pacman.conf only applies to -Syu, not to explicit -S <pkg>,
+ # so filter ignored names out of the list we pipe to paru. Otherwise every
+ # pkg-apply / pkg-fix would reinstall AUR pins (e.g. llama-cpp-vulkan)
+ # whenever the AUR has a newer commit.
+ ignored=$(awk '/^IgnorePkg[[:space:]]*=/ { sub(/^[^=]*=[[:space:]]*/, ""); print }' /etc/pacman.conf | tr ' ' '\n' | sed '/^$/d')
+ filter() { awk -v ig="$ignored" 'BEGIN{n=split(ig,a,"\n");for(i=1;i<=n;i++)x[a[i]]=1} !($0 in x)'; }
if [ -n "{{ groups }}" ]; then
for group in {{ groups }}; do
file="meta/${group}.txt"
@@ -1034,7 +1040,7 @@ pkg-apply *groups:
just _flatpak-install
continue
fi
- pkgs=$(sed -E 's/[[:space:]]*#.*$//; /^[[:space:]]*$/d' "$file")
+ pkgs=$(sed -E 's/[[:space:]]*#.*$//; /^[[:space:]]*$/d' "$file" | filter)
[ -n "$pkgs" ] || continue
printf '%s\n' "$pkgs" | paru -S --needed --noconfirm --ask=4 -
done
@@ -1042,13 +1048,15 @@ pkg-apply *groups:
find meta -maxdepth 1 -name '*.txt' ! -name 'flatpak.txt' -print0 \
| xargs -0 cat \
| sed -E 's/[[:space:]]*#.*$//; /^[[:space:]]*$/d' \
- | sort -u | paru -S --needed --noconfirm --ask=4 -
+ | sort -u | filter | paru -S --needed --noconfirm --ask=4 -
[ -f meta/flatpak.txt ] && just _flatpak-install
fi
# Top up missing packages in groups that are already ≥50% installed (never installs new groups)
pkg-fix:
#!/bin/sh
+ ignored=$(awk '/^IgnorePkg[[:space:]]*=/ { sub(/^[^=]*=[[:space:]]*/, ""); print }' /etc/pacman.conf | tr ' ' '\n' | sed '/^$/d')
+ filter() { awk -v ig="$ignored" 'BEGIN{n=split(ig,a,"\n");for(i=1;i<=n;i++)x[a[i]]=1} !($0 in x)'; }
flatpaks=$(flatpak list --user --app --columns=application 2>/dev/null || true)
for file in meta/*.txt; do
group=$(basename "$file" .txt)
@@ -1071,7 +1079,10 @@ pkg-fix:
if [ "$group" = "flatpak" ]; then
just _flatpak-install
else
- echo "$pkgs" | paru -S --needed --noconfirm --ask=4 -
+ # Strip IgnorePkg entries; explicit -S would bypass IgnorePkg.
+ pkgs_filtered=$(echo "$pkgs" | filter)
+ [ -n "$pkgs_filtered" ] || continue
+ echo "$pkgs_filtered" | paru -S --needed --noconfirm --ask=4 -
fi
fi
done