travis-ci: ask homebrew for its path instead of hardcoding it

The TravisCI macOS build is broken because homebrew (a macOS dependency
manager) changed its internal directory structure [1]. This is a problem
because we modify the Perforce dependencies in the homebrew repository
before installing them.

Fix it by asking homebrew for its path instead of hardcoding it.

[1] 0a09ae30f8

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Lars Schneider 2016-09-21 10:45:18 +02:00 committed by Junio C Hamano
parent 522354d70f
commit f86f49bee9

View file

@ -51,7 +51,7 @@ before_install:
FORMULA=$1
SHA=$(brew fetch --force $FORMULA 2>&1 | grep ^SHA256: | cut -d ' ' -f 2)
sed -E -i.bak "s/sha256 \"[0-9a-f]{64}\"/sha256 \"$SHA\"/g" \
/usr/local/Library/Taps/homebrew/homebrew-binary/$FORMULA.rb
"$(brew --repository homebrew/homebrew-binary)/$FORMULA.rb"
}
brew update --quiet
brew tap homebrew/binary --quiet