fix: a fresh Mac installs Homebrew before the brew stage
core/brew was `-builtin` on Darwin, and builtin runs after install_brew, so a Mac without Homebrew failed every brew row "brew missing" and needed a second run. It is a script row on both platforms now. The apt prerequisite line is guarded to apt platforms, and on macOS `sudo -v` caches the timestamp that NONINTERACTIVE=1 Homebrew requires. Darwin dispatch-order test via the fake uname, plus a mutation (G-boot-1).
This commit is contained in:
1 parent
6fa7603633
commit
91a1224a5e
4 files changed
+51
-6
No files matched your search
@@ -0,0 +1,11 @@
|
||||
# what: core/brew runs its apt prerequisites on every platform again
|
||||
# why: a Mac has no apt; the line warns, and the sudo it needs is never asked for
|
||||
# kills: darwin: no apt prerequisites on a machine with no apt
|
||||
# run: unit
|
||||
<<<OLD
|
||||
if [ "$PLAT" = apt ]; then
|
||||
# The installer's own documented prerequisites. git is already
|
||||
<<<NEW
|
||||
if true; then
|
||||
# The installer's own documented prerequisites. git is already
|
||||
<<<END
|
||||
@@ -492,6 +492,10 @@ is "darwin: claude desktop is the cask" "brew claude" "$(drs apps/cl
|
||||
is "darwin: signal is the cask" "brew signal" "$(drs apps/signal)"
|
||||
is "darwin: bun is the tap" "brew oven-sh/bun/bun" "$(drs core/bun)"
|
||||
is "darwin: incus has no source" "unavailable" "$(drs virt/incus | tr -d ' ')"
|
||||
# G-boot-1: core/brew was `builtin` here, and builtin runs AFTER the brew stage,
|
||||
# so a fresh Mac failed every brew row "brew missing" and only then installed
|
||||
# Homebrew. A script row runs before brew, on both platforms.
|
||||
is "darwin: homebrew itself is a script row" "script brew" "$(drs core/brew)"
|
||||
|
||||
# Nothing in the default set may be unresolvable — that is a manifest bug, and
|
||||
# it is silent until someone runs the installer on a fresh machine.
|
||||
@@ -762,6 +766,24 @@ else
|
||||
printf ' \033[33mskip\033[0m go sits at an absolute path find_tool probes\n'
|
||||
fi
|
||||
|
||||
printf '\n\033[1ma fresh Mac installs Homebrew before the brew stage\033[0m\n'
|
||||
# The seal's own uname swapped for the fake Mac one: the whole of the run, not
|
||||
# just resolution, believes it is on Darwin. A dry run, because what matters is
|
||||
# the ORDER of the commands, and --print shows exactly what a real run executes.
|
||||
newbox; sh ./seal.sh "$SB/seal" --with sudo >/dev/null
|
||||
ln -sf "$DARWIN/uname" "$SB/seal/uname"; BOXPATH=$SB/seal
|
||||
pick core/brew agents/herdr
|
||||
dry=$(box --print install 2>&1 | plain || true)
|
||||
is "darwin: the Homebrew installer runs before any brew install" "yes" \
|
||||
"$(a=$(printf '%s\n' "$dry" | grep -n 'Homebrew/install/HEAD/install.sh' | head -1 | cut -d: -f1)
|
||||
b=$(printf '%s\n' "$dry" | grep -n 'brew install herdr' | head -1 | cut -d: -f1)
|
||||
[ -n "$a" ] && [ -n "$b" ] && [ "$a" -lt "$b" ] && echo yes || echo "no [$a/$b]")"
|
||||
is "darwin: …after asking for sudo, which NONINTERACTIVE cannot" "yes" \
|
||||
"$(a=$(printf '%s\n' "$dry" | grep -n '+ sudo -v$' | head -1 | cut -d: -f1)
|
||||
b=$(printf '%s\n' "$dry" | grep -n 'Homebrew/install/HEAD/install.sh' | head -1 | cut -d: -f1)
|
||||
[ -n "$a" ] && [ -n "$b" ] && [ "$a" -lt "$b" ] && echo yes || echo "no [$a/$b]")"
|
||||
hasnt "darwin: no apt prerequisites on a machine with no apt" "apt-get" "$dry"
|
||||
|
||||
printf '\n\033[1mclaude desktop trusts only Anthropic'"'"'s key\033[0m\n'
|
||||
# A vendor apt repository is a key apt will trust for root-installed packages,
|
||||
# so the key is checked against the published fingerprint before it is placed.
|
||||
|
||||
Reference in new issue
Block a user