diff --git a/Library/Homebrew/dev-cmd/extract.rb b/Library/Homebrew/dev-cmd/extract.rb index bae5e4cb90..39fa4b8a56 100644 --- a/Library/Homebrew/dev-cmd/extract.rb +++ b/Library/Homebrew/dev-cmd/extract.rb @@ -226,6 +226,6 @@ module Homebrew contents = Utils::Git.last_revision_of_file(repo, file, before_commit: rev) contents.gsub!("@url=", "url ") contents.gsub!("require 'brewkit'", "require 'formula'") - with_monkey_patch { Formulary.from_contents(name, file, contents) } + with_monkey_patch { Formulary.from_contents(name, file, contents, ignore_errors: true) } end end diff --git a/Library/Homebrew/test/dev-cmd/extract_spec.rb b/Library/Homebrew/test/dev-cmd/extract_spec.rb index 214db27b9f..20f745e49a 100644 --- a/Library/Homebrew/test/dev-cmd/extract_spec.rb +++ b/Library/Homebrew/test/dev-cmd/extract_spec.rb @@ -14,9 +14,17 @@ describe "brew extract" do core_tap = CoreTap.new core_tap.path.cd do system "git", "init" - formula_file = setup_test_formula "testball" + # Start with deprecated bottle syntax + setup_test_formula "testball", bottle_block: <<~EOS + + bottle do + cellar :any + end + EOS system "git", "add", "--all" system "git", "commit", "-m", "testball 0.1" + # Replace with a valid formula for the next version + formula_file = setup_test_formula "testball" contents = File.read(formula_file) contents.gsub!("testball-0.1", "testball-0.2") File.write(formula_file, contents)