From bf199cf27138e12be05f9791fedccbe30d75f893 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 9 Apr 2021 09:17:24 +0100 Subject: [PATCH] Default Homebrew on Linux to use GitHub Packages. --- Library/Homebrew/brew.sh | 2 +- Library/Homebrew/cmd/vendor-install.sh | 12 ++++++++---- Library/Homebrew/env_config.rb | 2 +- docs/Manpage.md | 2 +- manpages/brew.1 | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index aa70f50ed8..370b47b805 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -446,7 +446,7 @@ if [[ -n "$HOMEBREW_MACOS" || -n "$HOMEBREW_FORCE_HOMEBREW_ON_LINUX" ]] then HOMEBREW_BOTTLE_DEFAULT_DOMAIN="https://ghcr.io/v2/homebrew/core" else - HOMEBREW_BOTTLE_DEFAULT_DOMAIN="https://linuxbrew.bintray.com" + HOMEBREW_BOTTLE_DEFAULT_DOMAIN="https://ghcr.io/v2/linuxbrew/core" fi HOMEBREW_USER_AGENT="$HOMEBREW_PRODUCT/$HOMEBREW_USER_AGENT_VERSION ($HOMEBREW_SYSTEM; $HOMEBREW_PROCESSOR $HOMEBREW_OS_USER_AGENT_VERSION)" diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh index 6566c1e2c8..29a0df94a7 100644 --- a/Library/Homebrew/cmd/vendor-install.sh +++ b/Library/Homebrew/cmd/vendor-install.sh @@ -19,8 +19,6 @@ then then ruby_FILENAME="portable-ruby-2.6.3_2.yosemite.bottle.tar.gz" ruby_SHA="b065e5e3783954f3e65d8d3a6377ca51649bfcfa21b356b0dd70490f74c6bd86" - ruby_URL="https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:$ruby_SHA" - ruby_URL2="https://homebrew.bintray.com/bottles-portable-ruby/$ruby_FILENAME" fi elif [[ -n "$HOMEBREW_LINUX" ]] then @@ -28,12 +26,18 @@ then x86_64) ruby_FILENAME="portable-ruby-2.6.3_2.x86_64_linux.bottle.tar.gz" ruby_SHA="97e639a64dcec285392b53ad804b5334c324f1d2a8bdc2b5087b8bf8051e332f" - ruby_URL="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/$ruby_FILENAME" - ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.6.3_2/$ruby_FILENAME" ;; esac fi +# Dynamic variables can't be detected by shellcheck +# shellcheck disable=SC2034 +if [[ -n "$ruby_SHA" && -n "$ruby_FILENAME" ]] +then + ruby_URL="https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:$ruby_SHA" + ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.6.3_2/$ruby_FILENAME" +fi + check_linux_glibc_version() { if [[ -z $HOMEBREW_LINUX || -z $HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION ]] then diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index bd55be7aab..95b1937295 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -53,7 +53,7 @@ module Homebrew "If bottles are not available at `HOMEBREW_BOTTLE_DOMAIN` " \ "they will be downloaded from the default bottle domain.", default_text: "macOS: `https://ghcr.io/v2/homebrew/core`, " \ - "Linux: `https://linuxbrew.bintray.com`.", + "Linux: `https://ghcr.io/v2/linuxbrew/core`.", default: HOMEBREW_BOTTLE_DEFAULT_DOMAIN, }, HOMEBREW_BREW_GIT_REMOTE: { diff --git a/docs/Manpage.md b/docs/Manpage.md index 009008ed8c..c148c0963c 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -1750,7 +1750,7 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just - `HOMEBREW_BOTTLE_DOMAIN`
Use this URL as the download mirror for bottles. If bottles at that URL are temporarily unavailable, the default bottle domain will be used as a fallback mirror. For example, `HOMEBREW_BOTTLE_DOMAIN=http://localhost:8080` will cause all bottles to download from the prefix `http://localhost:8080/`. If bottles are not available at `HOMEBREW_BOTTLE_DOMAIN` they will be downloaded from the default bottle domain. - *Default:* macOS: `https://ghcr.io/v2/homebrew/core`, Linux: `https://linuxbrew.bintray.com`. + *Default:* macOS: `https://ghcr.io/v2/homebrew/core`, Linux: `https://ghcr.io/v2/linuxbrew/core`. - `HOMEBREW_BREW_GIT_REMOTE`
Use this URL as the Homebrew/brew `git`(1) remote. diff --git a/manpages/brew.1 b/manpages/brew.1 index 1b5b4c059d..8cd304ea61 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -2458,7 +2458,7 @@ If set, use Bootsnap to speed up repeated \fBbrew\fR calls\. A no\-op when using Use this URL as the download mirror for bottles\. If bottles at that URL are temporarily unavailable, the default bottle domain will be used as a fallback mirror\. For example, \fBHOMEBREW_BOTTLE_DOMAIN=http://localhost:8080\fR will cause all bottles to download from the prefix \fBhttp://localhost:8080/\fR\. If bottles are not available at \fBHOMEBREW_BOTTLE_DOMAIN\fR they will be downloaded from the default bottle domain\. . .IP -\fIDefault:\fR macOS: \fBhttps://ghcr\.io/v2/homebrew/core\fR, Linux: \fBhttps://linuxbrew\.bintray\.com\fR\. +\fIDefault:\fR macOS: \fBhttps://ghcr\.io/v2/homebrew/core\fR, Linux: \fBhttps://ghcr\.io/v2/linuxbrew/core\fR\. . .TP \fBHOMEBREW_BREW_GIT_REMOTE\fR