1
0
Fork 0

Gentoo bootstrap: fix ambiguous package names + early-return on os_family mismatch

Three issues caught during tadbit onboarding:

1. run_once_00-install-bootstrap-tools.sh.tmpl (gentoo branch):
   'gnupg' is ambiguous (app-crypt/gnupg vs app-vim/gnupg). Use full
   category/package names: app-crypt/gnupg, app-crypt/age, etc.
   The previous 'for p in age curl ...' loop fed short names to
   emerge which printed '!!! The short ebuild name gnupg is
   ambiguous' and exited 1.

2. run_once_20-install-user-packages-gentoo.sh.tmpl:
   sys-devel/base-devel doesn't exist on Gentoo (it's an Arch/Fedora
   concept; Gentoo's toolchain is the @system set which is always
   installed). Removed base-devel from the package list.

3. Universal scripts (run_once_20 + run_once_40) were running on
   gentoo and hitting either 'die unsupported os_family' (universal
   20) or 'WARNING sway packages not configured for gentoo' (universal
   40). Added early-return: 'if os_family == gentoo, exit 0' at the
   top of each universal script so the gentoo-specific scripts
   handle the box. (Same pattern the chaotic-aur script already had.)

4. run_once_10-add-gentoo-overlays.sh.tmpl:
   The cached ~/.cache/eselect-repo/repositories.xml was corrupt on
   tadbit (lxml.etree.XMLSyntaxError on every 'eselect repository
   list' call). Added a sanity check: parse the XML with
   xml.etree.ElementTree, delete if invalid, re-fetch.

After these fixes, the bootstrap on tadbit is expected to run cleanly
with --keep-going (the four failures above all become no-ops).
This commit is contained in:
Rain 2026-06-23 16:18:54 -04:00
parent b5defc5a20
commit 4556813e78
5 changed files with 57 additions and 6 deletions

View file

@ -9,6 +9,11 @@
# zsh-history-substring-search, fzf-tab.
#
# Runs as the unprivileged user, but uses sudo for system packages.
#
# Note: this script handles arch and debian. Gentoo uses its own
# run_once_20-install-user-packages-gentoo.sh.tmpl. Without the early
# return below, this universal script would hit `die "unsupported
# os_family"` on gentoo and abort the apply chain.
# =============================================================================
set -euo pipefail
@ -27,6 +32,13 @@ export PATH="/usr/bin:/bin:$HOME/.local/bin:$HOME/.bun/bin:$HOME/.cargo/bin:$PAT
log() { printf '\033[1;34m[packages]\033[0m %s\n' "$*"; }
die() { printf '\033[1;31m[packages ERROR]\033[0m %s\n' "$*" >&2; exit 1; }
# --- 0. Gentoo uses its own user-packages script ---
{{ if eq .os_family "gentoo" -}}
log "user packages install handled by run_once_20-install-user-packages-gentoo.sh.tmpl on gentoo"
log "exiting to avoid running arch/debian-specific branches"
exit 0
{{ end -}}
USER_HOME="${HOME:-$(eval echo "~$(whoami)")}"
ZSH_CUSTOM="${ZSH_CUSTOM:-$USER_HOME/.oh-my-zsh/custom}"