Skip to content
Snippets Groups Projects
Unverified Commit 51af87f8 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

Add HOMEBREW_FORCE_HOMEBREW_ON_LINUX

This serves a similar purpose to the HOMEBREW_FORCE_HOMEBREW_ORG
variable but applies to more settings.
parent 864be6d8
No related branches found
No related tags found
No related merge requests found
......@@ -86,7 +86,6 @@ then
HOMEBREW_OS_VERSION="macOS $HOMEBREW_MACOS_VERSION"
# Don't change this from Mac OS X to match what macOS itself does in Safari on 10.12
HOMEBREW_OS_USER_AGENT_VERSION="Mac OS X $HOMEBREW_MACOS_VERSION"
HOMEBREW_BOTTLE_DEFAULT_DOMAIN="https://homebrew.bintray.com"
# The system Curl is too old for some modern HTTPS certificates on
# older macOS versions.
......@@ -114,13 +113,19 @@ else
[[ -n "$HOMEBREW_LINUX" ]] && HOMEBREW_OS_VERSION="$(lsb_release -sd 2>/dev/null)"
: "${HOMEBREW_OS_VERSION:=$(uname -r)}"
HOMEBREW_OS_USER_AGENT_VERSION="$HOMEBREW_OS_VERSION"
HOMEBREW_BOTTLE_DEFAULT_DOMAIN="https://linuxbrew.bintray.com"
CACHE_HOME="${XDG_CACHE_HOME:-${HOME}/.cache}"
HOMEBREW_CACHE="${HOMEBREW_CACHE:-${CACHE_HOME}/Homebrew}"
HOMEBREW_SYSTEM_TEMP="/tmp"
fi
if [[ -n "$HOMEBREW_MACOS" || -n "$HOMEBREW_FORCE_HOMEBREW_ON_LINUX" ]]
then
HOMEBREW_BOTTLE_DEFAULT_DOMAIN="https://homebrew.bintray.com"
else
HOMEBREW_BOTTLE_DEFAULT_DOMAIN="https://linuxbrew.bintray.com"
fi
HOMEBREW_TEMP="${HOMEBREW_TEMP:-${HOMEBREW_SYSTEM_TEMP}}"
if [[ -n "$HOMEBREW_FORCE_BREWED_CURL" &&
......
......@@ -24,7 +24,7 @@ git() {
git_init_if_necessary() {
BREW_OFFICIAL_REMOTE="https://github.com/Homebrew/brew"
if [[ -n "$HOMEBREW_MACOS" ]] || [[ -n "$HOMEBREW_FORCE_HOMEBREW_ORG" ]]
if [[ -n "$HOMEBREW_MACOS" ]] || [[ -n "$HOMEBREW_FORCE_HOMEBREW_ON_LINUX" ]]
then
CORE_OFFICIAL_REMOTE="https://github.com/Homebrew/homebrew-core"
else
......
class CoreTap < Tap
def default_remote
if ENV["HOMEBREW_FORCE_HOMEBREW_ORG"]
if ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"]
"https://github.com/Homebrew/homebrew-core".freeze
else
"https://github.com/Linuxbrew/homebrew-core".freeze
......
......@@ -54,7 +54,7 @@ HOMEBREW_USER_AGENT_FAKE_SAFARI =
# `HOMEBREW_BOTTLE_DEFAULT_DOMAIN` isn't set.
HOMEBREW_BOTTLE_DEFAULT_DOMAIN = if ENV["HOMEBREW_BOTTLE_DEFAULT_DOMAIN"]
ENV["HOMEBREW_BOTTLE_DEFAULT_DOMAIN"]
elsif OS.mac?
elsif OS.mac? || ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"]
"https://homebrew.bintray.com".freeze
else
"https://linuxbrew.bintray.com".freeze
......
module Homebrew
DEFAULT_PREFIX = "/home/linuxbrew/.linuxbrew".freeze
DEFAULT_PREFIX = if ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"]
"/usr/local".freeze
else
"/home/linuxbrew/.linuxbrew".freeze
end
end
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