Skip to content

Commit

Permalink
extract: Leave a hint in place of the removed bottles block
Browse files Browse the repository at this point in the history
  • Loading branch information
Kentzo committed Jun 29, 2024
1 parent a40f327 commit 429ad51
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/extract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def run
result.sub!("class #{class_name} < Formula", "class #{versioned_name} < Formula")

# Remove bottle blocks, as they won't work.
result.sub!(BOTTLE_BLOCK_REGEX, "")
result.sub!(BOTTLE_BLOCK_REGEX, "# The bottles might be available as oci images at docker://ghcr.io/homebrew/core/#{name}:#{version}")

path = destination_tap.path/"Formula/#{name}@#{version_string}.rb"
if path.exist?
Expand Down
10 changes: 10 additions & 0 deletions Library/Homebrew/test/dev-cmd/extract_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,15 @@
expect(path).to exist
expect(Formulary.factory(path).version).to eq "0.2"
end

it "notes the url where bottles might be found", :integration_test do
path = target[:path]/"Formula/[email protected]"
expect { brew "extract", "testball", target[:name] }
.to output(/^#{path}$/).to_stdout
.and not_to_output.to_stderr
.and be_a_success
expect(path).to exist
expect(File.read(path)).to match(%r{docker://ghcr.io/homebrew/core/testball:0.2})
end
end
end

0 comments on commit 429ad51

Please sign in to comment.