Merge pull request #11278 from iMichka/bottle
bottle: do not fail on missing bottle block
This commit is contained in:
commit
1a27e4fd4a
@ -790,10 +790,7 @@ module Homebrew
|
|||||||
|
|
||||||
def old_checksums(formula, formula_ast, bottle_hash, args:)
|
def old_checksums(formula, formula_ast, bottle_hash, args:)
|
||||||
bottle_node = formula_ast.bottle_block
|
bottle_node = formula_ast.bottle_block
|
||||||
if bottle_node.nil?
|
return if bottle_node.nil?
|
||||||
odie "`--keep-old` was passed but there was no existing bottle block!" if args.keep_old?
|
|
||||||
return
|
|
||||||
end
|
|
||||||
return [] unless args.keep_old?
|
return [] unless args.keep_old?
|
||||||
|
|
||||||
old_keys = Utils::AST.body_children(bottle_node.body).map(&:method_name)
|
old_keys = Utils::AST.body_children(bottle_node.body).map(&:method_name)
|
||||||
|
@ -273,25 +273,6 @@ describe "brew bottle" do
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
it "fails to add the bottle block to a formula that has no bottle block when using --keep-old" do
|
|
||||||
core_tap.path.cd do
|
|
||||||
system "git", "init"
|
|
||||||
setup_test_formula("testball")
|
|
||||||
system "git", "add", "--all"
|
|
||||||
system "git", "commit", "-m", "testball 0.1"
|
|
||||||
end
|
|
||||||
|
|
||||||
expect {
|
|
||||||
brew "bottle",
|
|
||||||
"--merge",
|
|
||||||
"--write",
|
|
||||||
"--keep-old",
|
|
||||||
"#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json",
|
|
||||||
"#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json",
|
|
||||||
"#{TEST_TMPDIR}/testball-1.0.catalina.bottle.json"
|
|
||||||
}.to output("Error: `--keep-old` was passed but there was no existing bottle block!\n").to_stderr
|
|
||||||
end
|
|
||||||
|
|
||||||
it "updates the bottle block in a formula that already has a bottle block (old format) when using --keep-old" do
|
it "updates the bottle block in a formula that already has a bottle block (old format) when using --keep-old" do
|
||||||
core_tap.path.cd do
|
core_tap.path.cd do
|
||||||
system "git", "init"
|
system "git", "init"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user