brew.sh: warn on $HOMEBREW_REPOSITORY/Cellar

If you’re using a /usr/local prefix but e.g. /usr/local/homebrew/Cellar
then you’ll miss out on most binary packages for no good reason so warn
people of that.
This commit is contained in:
Mike McQuaid 2016-10-11 09:37:37 +01:00
parent 6be6ce33e0
commit 981cac2a2e

View File

@ -277,6 +277,18 @@ EOS
} }
check-run-command-as-root check-run-command-as-root
if [[ "$HOMEBREW_PREFIX" = "/usr/local" &&
"$HOMEBREW_CELLAR" = "$HOMEBREW_REPOSITORY/Cellar" ]]
then
cat >&2 <<EOS
Warning: your HOMEBREW_PREFIX is set to /usr/local but HOMEBREW_CELLAR is set
to $HOMEBREW_CELLAR. Your current HOMEBREW_CELLAR location will stop
you being able to use all the binary packages (bottles) Homebrew provides. We
recommend you move your HOMEBREW_CELLAR to /usr/local/Cellar which will get you
access to all bottles."
EOS
fi
# Hide shellcheck complaint: # Hide shellcheck complaint:
# shellcheck source=/dev/null # shellcheck source=/dev/null
source "$HOMEBREW_LIBRARY/Homebrew/utils/analytics.sh" source "$HOMEBREW_LIBRARY/Homebrew/utils/analytics.sh"