brew.sh: fix repository auto-update change.
On auto-update `HOMEBREW_LIBRARY` may change location which means that it won't be found for the actual install command. Look for this having occurred and then set the new `HOMEBREW_LIBRARY` (and `HOMEBREW_REPOSITORY`) accordingly.
This commit is contained in:
parent
13f08a2bd4
commit
c30665afa6
@ -268,6 +268,17 @@ update-preinstall() {
|
||||
brew update --preinstall
|
||||
fi
|
||||
|
||||
# If brew update --preinstall did a migration then export the new locations.
|
||||
if [[ "$HOMEBREW_REPOSITORY" = "/usr/local" &&
|
||||
! -d "$HOMEBREW_REPOSITORY/.git" &&
|
||||
-d "/usr/local/Homebrew/.git" ]]
|
||||
then
|
||||
HOMEBREW_REPOSITORY="/usr/local/Homebrew"
|
||||
HOMEBREW_LIBRARY="$HOMEBREW_REPOSITORY/Library"
|
||||
export HOMEBREW_REPOSITORY
|
||||
export HOMEBREW_LIBRARY
|
||||
fi
|
||||
|
||||
# If we've checked for updates, we don't need to check again.
|
||||
export HOMEBREW_NO_AUTO_UPDATE="1"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user