fix: simplify brew PATH append after system's

This restores compatibility with upstream changes in shellenv.sh that don't affect the PATH

Credits: https://github.com/orgs/Homebrew/discussions/2560#discussioncomment-1716820
This commit is contained in:
Alberto García 2025-12-18 16:01:01 +01:00 committed by GitHub
parent bf5e939cd1
commit 22c2c8902f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,13 +3,6 @@
# Prioritize system binaries to prevent brew overriding things like dbus
# See: https://github.com/ublue-os/brew/blob/54b30cc07d3211fca65ca5cc724e9812c8c79b77/system_files/usr/lib/systemd/system/brew-upgrade.service#L17-L22
if [[ -d /home/linuxbrew/.linuxbrew && $- == *i* ]] ; then
export HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
export HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar"
export HOMEBREW_REPOSITORY="/home/linuxbrew/.linuxbrew/Homebrew"
[ -z "${MANPATH-}" ] || export MANPATH="${MANPATH#:}:"
export INFOPATH="${INFOPATH}:/home/linuxbrew/.linuxbrew/share/info"
export PATH="${PATH}:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin"
if [ "$(basename $(readlink /proc/$$/exe))" == "zsh" ] ; then
fpath[1,0]="/home/linuxbrew/.linuxbrew/share/zsh/site-functions"
fi
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv | egrep -v '\bPATH=')"
export PATH="${PATH}:${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin"
fi