From d537a5b577a97fd36aba44501e806a9b999f21e1 Mon Sep 17 00:00:00 2001 From: rain Date: Sun, 21 Jun 2026 23:20:40 -0400 Subject: [PATCH] Fix font check: pipefail + grep -q returns SIGPIPE 141 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bootstrap script has 'set -euo pipefail' at the top. The font check was 'fc-list 2>/dev/null | grep -qi "Maple Mono NF"'. With pipefail enabled, this fails: 1. grep -q exits 0 as soon as it finds the first match 2. grep closing its stdin early sends SIGPIPE to fc-list 3. fc-list exits with 141 (SIGPIPE) 4. With pipefail, the pipeline returns 141, not 0 5. The 'if' evaluates 141 as false → NO-MATCH 6. Bootstrap re-installs the font even though it's already there Discovered on kaiser: bootstrap kept failing at 'paru -S maplemono-nf-cn' because the font was already installed but the check said it wasn't. Fix: use bash string matching instead of a pipeline. [[ "$(fc-list 2>/dev/null)" == *"Maple Mono NF"* ]] This reads all output into a string (no pipe), then bash's built-in glob match handles the test. No pipefail issue. --- run_once_20-install-user-packages.sh.tmpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/run_once_20-install-user-packages.sh.tmpl b/run_once_20-install-user-packages.sh.tmpl index 8f1d0a0..69236e7 100755 --- a/run_once_20-install-user-packages.sh.tmpl +++ b/run_once_20-install-user-packages.sh.tmpl @@ -157,7 +157,11 @@ fi # Pin Maple-font version. Bump manually if a release breaks things. MAPLE_FONT_VERSION="v7.9" -if fc-list 2>/dev/null | grep -qi "Maple Mono NF"; then +# fc-list check: bash string match instead of pipeline, because `set -o pipefail` +# in this script causes `fc-list | grep -q` to fail with SIGPIPE (exit 141) when +# grep exits early on first match — the pipeline then reports non-zero, the +# `if` evaluates to false, and the bootstrap re-installs the font unnecessarily. +if [[ "$(fc-list 2>/dev/null)" == *"Maple Mono NF"* ]]; then log "Maple Mono NF already installed" else {{ if eq .os_family "arch" -}}