mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #20051 from Homebrew/internal-api-bare-minimum
Reduce the internal formula API to contain the bare minimum data
This commit is contained in:
commit
1f37a11b79
@ -75,9 +75,7 @@ module Homebrew
|
|||||||
Homebrew::API.merge_variations(cask, bottle_tag:)
|
Homebrew::API.merge_variations(cask, bottle_tag:)
|
||||||
end
|
end
|
||||||
|
|
||||||
unless args.dry_run?
|
File.write("api/internal/cask.#{bottle_tag}.json", JSON.generate(variation_casks)) unless args.dry_run?
|
||||||
File.write("api/internal/cask.#{bottle_tag}.json", JSON.pretty_generate(variation_casks))
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -69,12 +69,26 @@ module Homebrew
|
|||||||
File.write("_data/formula_canonical.json", "#{canonical_json}\n") unless args.dry_run?
|
File.write("_data/formula_canonical.json", "#{canonical_json}\n") unless args.dry_run?
|
||||||
|
|
||||||
OnSystem::VALID_OS_ARCH_TAGS.each do |bottle_tag|
|
OnSystem::VALID_OS_ARCH_TAGS.each do |bottle_tag|
|
||||||
variation_formulae = all_formulae.map do |_, formula|
|
variation_formulae = all_formulae.to_h do |name, formula|
|
||||||
Homebrew::API.merge_variations(formula, bottle_tag:)
|
formula = Homebrew::API.merge_variations(formula, bottle_tag:)
|
||||||
|
|
||||||
|
version = Version.new(formula.dig("versions", "stable"))
|
||||||
|
pkg_version = PkgVersion.new(version, formula["revision"])
|
||||||
|
rebuild = formula.dig("bottle", "stable", "rebuild") || 0
|
||||||
|
|
||||||
|
bottle_collector = Utils::Bottles::Collector.new
|
||||||
|
formula.dig("bottle", "stable", "files")&.each do |tag, data|
|
||||||
|
tag = Utils::Bottles::Tag.from_symbol(tag)
|
||||||
|
bottle_collector.add tag, checksum: Checksum.new(data["sha256"]), cellar: :any
|
||||||
|
end
|
||||||
|
|
||||||
|
sha256 = bottle_collector.specification_for(bottle_tag)&.checksum&.to_s
|
||||||
|
|
||||||
|
[name, [pkg_version.to_s, rebuild, sha256]]
|
||||||
end
|
end
|
||||||
|
|
||||||
unless args.dry_run?
|
unless args.dry_run?
|
||||||
File.write("api/internal/formula.#{bottle_tag}.json", JSON.pretty_generate(variation_formulae))
|
File.write("api/internal/formula.#{bottle_tag}.json", JSON.generate(variation_formulae))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -47,7 +47,7 @@ module Utils
|
|||||||
return if tag_version.blank?
|
return if tag_version.blank?
|
||||||
|
|
||||||
tags.find do |candidate|
|
tags.find do |candidate|
|
||||||
next if candidate.arch != tag.arch
|
next if candidate.standardized_arch != tag.standardized_arch
|
||||||
|
|
||||||
candidate.to_macos_version <= tag_version
|
candidate.to_macos_version <= tag_version
|
||||||
rescue MacOSVersion::Error
|
rescue MacOSVersion::Error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user