Merge pull request #18350 from Homebrew/fail-when-no-longer-all-bottle

dev-cmd/bottle: improve `:all` bottle handling
This commit is contained in:
Mike McQuaid 2024-09-18 17:21:29 +01:00 committed by GitHub
commit 21bb3e15bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -743,6 +743,14 @@ module Homebrew
tag_hashes.count > 1 && tag_hashes.count > 1 &&
tag_hashes.uniq { |tag_hash| "#{tag_hash["cellar"]}-#{tag_hash["sha256"]}" }.count == 1 tag_hashes.uniq { |tag_hash| "#{tag_hash["cellar"]}-#{tag_hash["sha256"]}" }.count == 1
old_all_bottle = old_bottle_spec.tag?(Utils::Bottles.tag(:all))
if !all_bottle && old_all_bottle && !args.no_all_checks?
odie <<~ERROR
#{formula} should have an `:all` bottle but one cannot be created:
#{JSON.pretty_generate(tag_hashes)}
ERROR
end
bottle_hash["bottle"]["tags"].each do |tag, tag_hash| bottle_hash["bottle"]["tags"].each do |tag, tag_hash|
cellar = tag_hash["cellar"] cellar = tag_hash["cellar"]
cellar = cellar.to_sym if any_cellars.include?(cellar) cellar = cellar.to_sym if any_cellars.include?(cellar)