cmd/untap: be more careful about formula tap.

`Formula#any_version_installed?` doesn't consider taps so we need to
manually check the tabs from the kegs instead.

See https://github.com/Homebrew/brew/pull/16330#issuecomment-1854007492
onwards for relevant discussion.
This commit is contained in:
Mike McQuaid 2023-12-13 15:24:37 +00:00
parent bd378a7b25
commit fbd3d4e48a
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829

View File

@ -40,7 +40,9 @@ module Homebrew
next
end
formula if formula.any_version_installed?
# Can't use Formula#any_version_installed? because it doesn't consider
# taps correctly.
formula if formula.installed_kegs.any? { |keg| keg.tab.tap == tap }
end.compact
installed_cask_tokens = T.let(nil, T.nilable(T::Set[String]))