1
0
Fork 0

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
This commit is contained in:
Rain 2026-06-21 22:41:28 -04:00
parent a6582de626
commit ddf2ca4da1

View file

@ -49,6 +49,7 @@ APT_PKGS=(
unzip p7zip unzip p7zip
openssh-client openssh-client
ca-certificates curl wget ca-certificates curl wget
fontconfig
) )
log "installing apt packages" log "installing apt packages"
@ -177,8 +178,12 @@ else
log "extracting font files" log "extracting font files"
unzip -q -o "$TMP_ZIP" -d "$FONT_DIR" unzip -q -o "$TMP_ZIP" -d "$FONT_DIR"
rm -f "$TMP_ZIP" rm -f "$TMP_ZIP"
log "running fc-cache" log "refreshing font cache (fc-cache)"
fc-cache -fv >/dev/null 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 else
log "WARNING: failed to download Maple Mono NF — nvim will warn about missing font" log "WARNING: failed to download Maple Mono NF — nvim will warn about missing font"
log "manual install: https://github.com/subframe7536/Maple-font" log "manual install: https://github.com/subframe7536/Maple-font"