From 1481eac57c92144eb67fd34b9adad81e94be2b59 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 15 Aug 2023 11:42:02 +0100 Subject: [PATCH] brew.sh: don't set `HOMEBREW_NO_INSTALL_FROM_API` automatically. My understanding is that now https://github.com/Homebrew/brew/pull/15778 has been merged this should now work fine on both older macOS versions and non-default prefixes so let's try this again. --- Library/Homebrew/brew.sh | 16 ---------------- Library/Homebrew/cmd/update-report.rb | 3 +-- Library/Homebrew/env_config.rb | 5 ----- docs/Installation.md | 2 -- 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 2914192a1b31b..9710cf1ad43a6 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -533,8 +533,6 @@ then # shellcheck disable=SC2086,SC2183 printf -v HOMEBREW_MACOS_VERSION_NUMERIC "%02d%02d%02d" ${HOMEBREW_MACOS_VERSION//./ } # shellcheck disable=SC2248 - printf -v HOMEBREW_MACOS_OLDEST_SUPPORTED_NUMERIC "%02d%02d%02d" ${HOMEBREW_MACOS_OLDEST_SUPPORTED//./ } - # shellcheck disable=SC2248 printf -v HOMEBREW_MACOS_OLDEST_ALLOWED_NUMERIC "%02d%02d%02d" ${HOMEBREW_MACOS_OLDEST_ALLOWED//./ } # Don't include minor versions for Big Sur and later. @@ -593,13 +591,6 @@ then # shellcheck disable=SC2034 HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH="1" fi - - # Don't support API at this time for older macOS versions. - if [[ "${HOMEBREW_MACOS_VERSION_NUMERIC}" -lt "${HOMEBREW_MACOS_OLDEST_SUPPORTED_NUMERIC}" ]] - then - export HOMEBREW_INSTALL_FROM_API_UNSUPPORTED=1 - export HOMEBREW_NO_INSTALL_FROM_API=1 - fi else HOMEBREW_PRODUCT="${HOMEBREW_SYSTEM}brew" [[ -n "${HOMEBREW_LINUX}" ]] && HOMEBREW_OS_VERSION="$(source /etc/os-release && echo "${PRETTY_NAME}")" @@ -672,13 +663,6 @@ Your Git executable: $(unset git && type -p "${HOMEBREW_GIT}")" fi fi -# Generic OS or non-default prefix: API not supported. -if [[ (-z "${HOMEBREW_MACOS}" && -z "${HOMEBREW_LINUX}") || "${HOMEBREW_PREFIX}" != "${HOMEBREW_DEFAULT_PREFIX}" ]] -then - export HOMEBREW_INSTALL_FROM_API_UNSUPPORTED=1 - export HOMEBREW_NO_INSTALL_FROM_API=1 -fi - setup_ca_certificates() { if [[ -n "${HOMEBREW_FORCE_BREWED_CA_CERTIFICATES}" && -f "${HOMEBREW_PREFIX}/etc/ca-certificates/cert.pem" ]] then diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index 0f970d442ebcd..2f06c84c2d8a5 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -377,8 +377,7 @@ def install_from_api_message !ENV["HOMEBREW_GITHUB_HOSTED_RUNNER"] && !ENV["GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED"] no_install_from_api_set = Homebrew::EnvConfig.no_install_from_api? && - !Homebrew::EnvConfig.automatically_set_no_install_from_api? && - !Homebrew::EnvConfig.install_from_api_unsupported? + !Homebrew::EnvConfig.automatically_set_no_install_from_api? return if !no_auto_update_set && !no_install_from_api_set && !auto_update_secs_set ohai "You have set:" diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index b3784b8711fc7..431451e7d7be2 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -498,10 +498,5 @@ def cask_opts_require_sha? def automatically_set_no_install_from_api? ENV["HOMEBREW_AUTOMATICALLY_SET_NO_INSTALL_FROM_API"].present? end - - sig { returns(T::Boolean) } - def install_from_api_unsupported? - ENV["HOMEBREW_INSTALL_FROM_API_UNSUPPORTED"].present? - end end end diff --git a/docs/Installation.md b/docs/Installation.md index d79873a49cb0c..418a5013caf9b 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -38,8 +38,6 @@ export HOMEBREW_NO_INSTALL_FROM_API=1 This will make Homebrew install formulae and casks from the `homebrew/core` and `homebrew/cask` taps using local checkouts of these repositories instead of Homebrew’s API. -Note that this will automatically be set on unsupported configurations (i.e. not using the default Homebrew prefix or, if on macOS, on an unsupported version). - ## Unattended installation If you want a non-interactive run of the Homebrew installer that doesn't prompt for passwords (e.g. in automation scripts), prepend [`NONINTERACTIVE=1`](https://github.com/Homebrew/install/#install-homebrew-on-macos-or-linux) to the installation command.