From ddf2ca4da1e9eae2c237d9b907bd03a31b47e190 Mon Sep 17 00:00:00 2001 From: rain Date: Sun, 21 Jun 2026 22:41:28 -0400 Subject: [PATCH] Add fontconfig to debian apt deps, make fc-cache non-fatal Discovered on crouton bootstrap: a fresh debian install may not have fontconfig installed, so fc-cache is missing. The script's font install step crashed at fc-cache, aborting the rest of the bootstrap (cargo install bat never ran). Fixes: 1. Add fontconfig to APT_PKGS so fc-cache and fc-list are present on debian from the start (matches what's typically pre-installed on most desktop distros but not on minimal server installs) 2. Wrap fc-cache in 'command -v' guard so if the package somehow isn't installed, the script logs a warning and continues instead of aborting the whole chain --- run_once_20-install-user-packages.sh.tmpl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/run_once_20-install-user-packages.sh.tmpl b/run_once_20-install-user-packages.sh.tmpl index c220039..0ee2a0c 100755 --- a/run_once_20-install-user-packages.sh.tmpl +++ b/run_once_20-install-user-packages.sh.tmpl @@ -49,6 +49,7 @@ APT_PKGS=( unzip p7zip openssh-client ca-certificates curl wget + fontconfig ) log "installing apt packages" @@ -177,8 +178,12 @@ else log "extracting font files" unzip -q -o "$TMP_ZIP" -d "$FONT_DIR" rm -f "$TMP_ZIP" - log "running fc-cache" - fc-cache -fv >/dev/null + log "refreshing font cache (fc-cache)" + if command -v fc-cache >/dev/null 2>&1; then + fc-cache -fv >/dev/null + else + log "WARNING: fc-cache not found — install fontconfig package" + fi else log "WARNING: failed to download Maple Mono NF — nvim will warn about missing font" log "manual install: https://github.com/subframe7536/Maple-font"