mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Reduce the internal formula API to contain the bare minimum data
This commit is contained in:
parent
0b67caf718
commit
b44ec56267
@ -75,9 +75,7 @@ module Homebrew
|
||||
Homebrew::API.merge_variations(cask, bottle_tag:)
|
||||
end
|
||||
|
||||
unless args.dry_run?
|
||||
File.write("api/internal/cask.#{bottle_tag}.json", JSON.pretty_generate(variation_casks))
|
||||
end
|
||||
File.write("api/internal/cask.#{bottle_tag}.json", JSON.generate(variation_casks)) unless args.dry_run?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -70,11 +70,19 @@ module Homebrew
|
||||
|
||||
OnSystem::VALID_OS_ARCH_TAGS.each do |bottle_tag|
|
||||
variation_formulae = all_formulae.map do |_, 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
|
||||
sha256 = formula.dig("bottle", "stable", "files", :all, "sha256")
|
||||
sha256 ||= formula.dig("bottle", "stable", "files", bottle_tag.to_sym, "sha256")
|
||||
|
||||
[formula["name"], pkg_version.to_s, rebuild, sha256]
|
||||
end
|
||||
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user