formula: add :default_prefix as a standard pour_bottle? requirement

See discussion at Homebrew/homebrew-core#81408.
This commit is contained in:
Carlo Cabrera 2021-07-19 20:02:29 +08:00
parent 4c3a8c7e5a
commit 1ceaa2ebd3
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -3016,6 +3016,15 @@ class Formula
T.cast(self, PourBottleCheck).satisfy { MacOS::CLT.installed? }
end
end
when :default_prefix
lambda do |_|
on_macos do
T.cast(self, PourBottleCheck).reason(+<<~EOS)
The bottle needs to be installed into #{Homebrew::DEFAULT_PREFIX}.
EOS
T.cast(self, PourBottleCheck).satisfy { HOMEBREW_PREFIX.to_s == Homebrew::DEFAULT_PREFIX }
end
end
else
raise ArgumentError, "Invalid preset `pour_bottle?` condition" if only_if.present?
end