From dd1a36052c1cc9313f3ddacce9c78f95d153551c Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Wed, 27 Oct 2021 01:41:57 -0400 Subject: [PATCH 1/4] Fix `brew doctor` --- Library/Homebrew/diagnostic.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 8cc52b3455..902fd8eb33 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -591,6 +591,8 @@ module Homebrew def check_coretap_integrity coretap = CoreTap.instance + return if !coretap.installed? && EnvConfig.install_from_api? + broken_tap(coretap) || examine_git_origin(coretap.path, Homebrew::EnvConfig.core_git_remote) end @@ -722,6 +724,8 @@ module Homebrew end repos.each do |name, path| + next unless path.exist? + status = path.cd do `git status --untracked-files=all --porcelain 2>/dev/null` end @@ -877,11 +881,13 @@ module Homebrew end def check_deleted_formula - keg_names = Keg.all.map(&:name).uniq + kegs = Keg.all - deleted_formulae = keg_names.map do |keg_name| - keg_name if Formulary.tap_paths(keg_name).blank? - end.compact + deleted_formulae = kegs.map do |keg| + next if !CoreTap.instance.installed? && EnvConfig.install_from_api? && Tab.for_keg(keg).tap.core_tap? + + keg.name if Formulary.tap_paths(keg.name).blank? + end.compact.uniq return if deleted_formulae.blank? From 7bb69e0b4c594016cf04091472f31f0fb9c71cf9 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Wed, 27 Oct 2021 01:42:08 -0400 Subject: [PATCH 2/4] Fix `brew install` with tap regex --- Library/Homebrew/cmd/install.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index dd64ddb615..95fceb3060 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -138,6 +138,7 @@ module Homebrew end args.named.each do |name| + next if EnvConfig.install_from_api? next if File.exist?(name) next if name !~ HOMEBREW_TAP_FORMULA_REGEX && name !~ HOMEBREW_CASK_TAP_CASK_REGEX From 2e78389516501a74d639498b5c99acbaf6d90ebe Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Wed, 27 Oct 2021 02:09:55 -0400 Subject: [PATCH 3/4] Improve `HOMEBREW_INSTALL_FROM_API` description --- Library/Homebrew/env_config.rb | 3 ++- docs/Manpage.md | 2 ++ manpages/brew.1 | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index b0039ae23f..ee7636e5c3 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -191,7 +191,8 @@ module Homebrew }, HOMEBREW_INSTALL_FROM_API: { description: "If set, install formulae and casks in homebrew/core and homebrew/cask taps using Homebrew's " \ - "API instead of needing (large, slow) local checkouts of these repositories.", + "API instead of needing (large, slow) local checkouts of these repositories." \ + "\n\n *Note:* Users with developer mode enabled cannot set HOMEBREW_INSTALL_FROM_API.", boolean: true, }, HOMEBREW_LIVECHECK_WATCHLIST: { diff --git a/docs/Manpage.md b/docs/Manpage.md index e4b09b2a20..d66d7c894b 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -2032,6 +2032,8 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just - `HOMEBREW_INSTALL_FROM_API`
If set, install formulae and casks in homebrew/core and homebrew/cask taps using Homebrew's API instead of needing (large, slow) local checkouts of these repositories. + *Note:* Users with developer mode enabled cannot set HOMEBREW_INSTALL_FROM_API. + - `HOMEBREW_LIVECHECK_WATCHLIST`
Consult this file for the list of formulae to check by default when no formula argument is passed to `brew livecheck`. diff --git a/manpages/brew.1 b/manpages/brew.1 index 81bbfc2982..4af992273f 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -2933,6 +2933,9 @@ Print this text before the installation summary of each successful build\. .br If set, install formulae and casks in homebrew/core and homebrew/cask taps using Homebrew\'s API instead of needing (large, slow) local checkouts of these repositories\. . +.IP +\fINote:\fR Users with developer mode enabled cannot set HOMEBREW_INSTALL_FROM_API\. +. .TP \fBHOMEBREW_LIVECHECK_WATCHLIST\fR . From 4d1aeea36f18b6962488131292411dabe01a3033 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 27 Oct 2021 11:43:15 +0100 Subject: [PATCH 4/4] env_config: tweak HOMEBREW_INSTALL_FROM_API wording. --- Library/Homebrew/env_config.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index ee7636e5c3..007b80a302 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -192,7 +192,8 @@ module Homebrew HOMEBREW_INSTALL_FROM_API: { description: "If set, install formulae and casks in homebrew/core and homebrew/cask taps using Homebrew's " \ "API instead of needing (large, slow) local checkouts of these repositories." \ - "\n\n *Note:* Users with developer mode enabled cannot set HOMEBREW_INSTALL_FROM_API.", + "\n\n *Note:* Setting HOMEBREW_INSTALL_FROM_API is not compatible with Homebrew's " \ + "developer mode so will error (as Homebrew development needs a full clone).", boolean: true, }, HOMEBREW_LIVECHECK_WATCHLIST: {