formula: only include sha256 for core formulae in bottle JSON

This commit is contained in:
Rylan Polster 2021-06-05 12:31:55 -04:00
parent d60f549a48
commit aebaa7f8df
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64
2 changed files with 3 additions and 6 deletions

View File

@ -1914,10 +1914,8 @@ class Formula
bottle = bottle_hash
bottles = bottle["files"].map do |tag, file|
info = {
"url" => file["url"],
"sha256" => file["sha256"],
}
info = { "url" => file["url"] }
info["sha256"] = file["sha256"] unless tap.name == "homebrew/core"
[tag.to_s, info]
end.to_h

View File

@ -886,8 +886,7 @@ describe Formula do
expect(h).to be_a(Hash)
expect(h["name"]).to eq "foo"
expect(h["bottles"].keys).to eq [Utils::Bottles.tag.to_s, "x86_64_foo"]
expect(h["bottles"][Utils::Bottles.tag.to_s].keys).to eq ["url", "sha256"]
expect(h["bottles"][Utils::Bottles.tag.to_s]["sha256"]).to eq TEST_SHA256
expect(h["bottles"][Utils::Bottles.tag.to_s].keys).to eq ["url"]
expect(h["dependencies"]).to eq []
end