Skip to content

Commit

Permalink
brew.sh: set HOMEBREW_FORCE_HOMEBREW_ON_LINUX when core repo is homeb…
Browse files Browse the repository at this point in the history
…rew-core

See Homebrew/install#571

When the install script sets as https://github.com/Homebrew/homebrew-core,
we need to use the homebrew-core bottle domain, and correctly set
the HOMEBREW_CORE_DEFAULT_GIT_REMOTE below.

This also fixes the brew doctor issue for new homebrew-core Linux installations

Warning: Suspicious https://github.com/Homebrew/linuxbrew-core git origin remote found.
The current git origin is:
  https://github.com/Homebrew/homebrew-core

With a non-standard origin, Homebrew won't update properly.
You can solve this by setting the origin remote:
  git -C "/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core" remote set-url origin https://github.com/Homebrew/linuxbrew-core
  • Loading branch information
iMichka committed Aug 29, 2021
1 parent 6da8630 commit 5ba9c8d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,15 @@ Your Git executable: $(unset git && type -p ${HOMEBREW_GIT})"

HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION="2.13"
unset HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH

HOMEBREW_CORE_REPOSITORY_ORIGIN="$("${HOMEBREW_GIT}" -C "${HOMEBREW_CORE_REPOSITORY}" remote get-url origin)"
if [[ "${HOMEBREW_CORE_REPOSITORY_ORIGIN}" = "https://github.com/Homebrew/homebrew-core" ]]
then
# If the remote origin has been set to Homebrew/homebrew-core by the install script,
# then we are in the case of a new installation of brew, using Homebrew/homebrew-core as a Linux core repository.
# In that case, set HOMEBREW_FORCE_HOMEBREW_ON_LINUX=1 to set the right HOMEBREW_BOTTLE_DOMAIN below.
export HOMEBREW_FORCE_HOMEBREW_ON_LINUX="1"
fi
fi

# A bug in the auto-update process prior to 3.1.2 means $HOMEBREW_BOTTLE_DOMAIN
Expand Down

0 comments on commit 5ba9c8d

Please sign in to comment.