mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
brew.sh: set HOMEBREW_CELLAR after default prefix
Fixes #14557. This allows correcting the prefix variables first. See #15656. Co-Authored-By: rohanssrao <17805516+rohanssrao@users.noreply.github.com>
This commit is contained in:
parent
4bbc0af693
commit
287a359a74
@ -13,17 +13,6 @@ case "${HOMEBREW_SYSTEM}" in
|
|||||||
Linux) HOMEBREW_LINUX="1" ;;
|
Linux) HOMEBREW_LINUX="1" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Where we store built products; a Cellar in HOMEBREW_PREFIX (often /usr/local
|
|
||||||
# for bottles) unless there's already a Cellar in HOMEBREW_REPOSITORY.
|
|
||||||
# These variables are set by bin/brew
|
|
||||||
# shellcheck disable=SC2154
|
|
||||||
if [[ -d "${HOMEBREW_REPOSITORY}/Cellar" ]]
|
|
||||||
then
|
|
||||||
HOMEBREW_CELLAR="${HOMEBREW_REPOSITORY}/Cellar"
|
|
||||||
else
|
|
||||||
HOMEBREW_CELLAR="${HOMEBREW_PREFIX}/Cellar"
|
|
||||||
fi
|
|
||||||
|
|
||||||
HOMEBREW_MACOS_ARM_DEFAULT_PREFIX="/opt/homebrew"
|
HOMEBREW_MACOS_ARM_DEFAULT_PREFIX="/opt/homebrew"
|
||||||
HOMEBREW_MACOS_ARM_DEFAULT_REPOSITORY="${HOMEBREW_MACOS_ARM_DEFAULT_PREFIX}"
|
HOMEBREW_MACOS_ARM_DEFAULT_REPOSITORY="${HOMEBREW_MACOS_ARM_DEFAULT_PREFIX}"
|
||||||
HOMEBREW_LINUX_DEFAULT_PREFIX="/home/linuxbrew/.linuxbrew"
|
HOMEBREW_LINUX_DEFAULT_PREFIX="/home/linuxbrew/.linuxbrew"
|
||||||
@ -55,6 +44,17 @@ else
|
|||||||
HOMEBREW_DEFAULT_TEMP="/tmp"
|
HOMEBREW_DEFAULT_TEMP="/tmp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Where we store built products; a Cellar in HOMEBREW_PREFIX (often /usr/local
|
||||||
|
# for bottles) unless there's already a Cellar in HOMEBREW_REPOSITORY.
|
||||||
|
# These variables are set by bin/brew
|
||||||
|
# shellcheck disable=SC2154
|
||||||
|
if [[ -d "${HOMEBREW_REPOSITORY}/Cellar" ]]
|
||||||
|
then
|
||||||
|
HOMEBREW_CELLAR="${HOMEBREW_REPOSITORY}/Cellar"
|
||||||
|
else
|
||||||
|
HOMEBREW_CELLAR="${HOMEBREW_PREFIX}/Cellar"
|
||||||
|
fi
|
||||||
|
|
||||||
HOMEBREW_CACHE="${HOMEBREW_CACHE:-${HOMEBREW_DEFAULT_CACHE}}"
|
HOMEBREW_CACHE="${HOMEBREW_CACHE:-${HOMEBREW_DEFAULT_CACHE}}"
|
||||||
HOMEBREW_LOGS="${HOMEBREW_LOGS:-${HOMEBREW_DEFAULT_LOGS}}"
|
HOMEBREW_LOGS="${HOMEBREW_LOGS:-${HOMEBREW_DEFAULT_LOGS}}"
|
||||||
HOMEBREW_TEMP="${HOMEBREW_TEMP:-${HOMEBREW_DEFAULT_TEMP}}"
|
HOMEBREW_TEMP="${HOMEBREW_TEMP:-${HOMEBREW_DEFAULT_TEMP}}"
|
||||||
|
2
bin/brew
2
bin/brew
@ -40,7 +40,7 @@ do
|
|||||||
done
|
done
|
||||||
unset cmd
|
unset cmd
|
||||||
|
|
||||||
BREW_FILE_DIRECTORY="$(quiet_cd "${0%/*}/" && pwd -P)"
|
BREW_FILE_DIRECTORY="$(quiet_cd "${0%/*}/" && pwd)"
|
||||||
HOMEBREW_BREW_FILE="${BREW_FILE_DIRECTORY%/}/${0##*/}"
|
HOMEBREW_BREW_FILE="${BREW_FILE_DIRECTORY%/}/${0##*/}"
|
||||||
HOMEBREW_PREFIX="${HOMEBREW_BREW_FILE%/*/*}"
|
HOMEBREW_PREFIX="${HOMEBREW_BREW_FILE%/*/*}"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user