Skip to content
Snippets Groups Projects
Commit 2aecfe60 authored by Maxim Belkin's avatar Maxim Belkin
Browse files

Update logic that handles HOMEBREW_GIT_PATH.

parent c3231a40
No related branches found
No related tags found
No related merge requests found
......@@ -351,7 +351,7 @@ else
if [[ $(numeric "${curl_name_and_version##* }") -lt $(numeric "$HOMEBREW_MINIMUM_CURL_VERSION") ]]
then
message="Please update your system cURL.
Minimum required version: ${HOMEBREW_MINIMUM_CURL_VERSION}.
Minimum required version: ${HOMEBREW_MINIMUM_CURL_VERSION}
Your cURL version: ${curl_name_and_version##* }
Your cURL executable: $(type -p $HOMEBREW_CURL)"
......@@ -376,16 +376,18 @@ Your cURL executable: $(type -p $HOMEBREW_CURL)"
IFS=. read -r major minor micro build extra <<< "${git_version_output##* }"
if [[ $(numeric "$major.$minor.$micro.$build") -lt $(numeric "$HOMEBREW_MINIMUM_GIT_VERSION") ]]
then
if [[ -z $HOMEBREW_GIT_PATH ]]; then
message="Please update your system Git.
Minimum required version: ${HOMEBREW_MINIMUM_GIT_VERSION}.
Your Git version: $major.$minor.$micro.$build
Your Git executable: $(unset git && type -p $HOMEBREW_GIT)"
if [[ -z $HOMEBREW_GIT_PATH || -z $HOMEBREW_DEVELOPER ]]; then
HOMEBREW_FORCE_BREWED_GIT="1"
if [[ -z $HOMEBREW_GIT_WARNING ]]; then
onoe "$message"
HOMEBREW_GIT_WARNING=1
fi
else
odie <<EOS
The version of Git that you provided to Homebrew using HOMEBREW_GIT_PATH is too old.
Minimum required version: ${HOMEBREW_MINIMUM_GIT_VERSION}.
Your Git version: $major.$minor.$micro.$build.
Please point Homebrew to Git ${HOMEBREW_MINIMUM_CURL_VERSION} or newer
or unset HOMEBREW_GIT_PATH variable.
EOS
odie "$message"
fi
fi
......@@ -424,6 +426,7 @@ export HOMEBREW_CURL
export HOMEBREW_CURL_WARNING
export HOMEBREW_SYSTEM_CURL_TOO_OLD
export HOMEBREW_GIT
export HOMEBREW_GIT_WARNING
export HOMEBREW_MINIMUM_GIT_VERSION
export HOMEBREW_PROCESSOR
export HOMEBREW_PRODUCT
......
......@@ -373,7 +373,7 @@ EOS
! -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" ]]
then
# we cannot install a Homebrew cURL if homebrew/core is unavailable.
if [[ -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]] && ! brew install curl
if [[ ! -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]] || ! brew install curl
then
odie "Curl must be installed and in your PATH!"
fi
......@@ -384,7 +384,7 @@ EOS
! -x "$HOMEBREW_PREFIX/opt/git/bin/git" ]]
then
# we cannot install a Homebrew Git if homebrew/core is unavailable.
if [[ -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]] && ! brew install git
if [[ ! -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]] || ! brew install git
then
odie "Git must be installed and in your PATH!"
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment