Port Homebrew::DevCmd::Bottle

This commit is contained in:
Douglas Eichelberger 2024-03-18 12:31:44 -07:00
parent 0f2efd3939
commit ee0c967ce0
3 changed files with 792 additions and 786 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,23 +2,25 @@
# frozen_string_literal: true
module Homebrew
class << self
undef tar_args
module DevCmd
class Bottle < AbstractCommand
undef tar_args
sig { returns(T::Array[String]) }
def tar_args
if MacOS.version >= :catalina
["--no-mac-metadata", "--no-acls", "--no-xattrs"].freeze
else
[].freeze
sig { returns(T::Array[String]) }
def tar_args
if MacOS.version >= :catalina
["--no-mac-metadata", "--no-acls", "--no-xattrs"].freeze
else
[].freeze
end
end
end
undef gnu_tar
undef gnu_tar
sig { params(gnu_tar_formula: Formula).returns(String) }
def gnu_tar(gnu_tar_formula)
"#{gnu_tar_formula.opt_bin}/gtar"
sig { params(gnu_tar_formula: Formula).returns(String) }
def gnu_tar(gnu_tar_formula)
"#{gnu_tar_formula.opt_bin}/gtar"
end
end
end
end

View File

@ -3,7 +3,7 @@
require "cmd/shared_examples/args_parse"
require "dev-cmd/bottle"
RSpec.describe "brew bottle" do
RSpec.describe Homebrew::DevCmd::Bottle do
def stub_hash(parameters)
<<~EOS
{
@ -30,7 +30,7 @@ RSpec.describe "brew bottle" do
EOS
end
it_behaves_like "parseable arguments"
it_behaves_like "parseable arguments", argv: ["foo"]
it "builds a bottle for the given Formula", :integration_test do
install_test_formula "testball", build_bottle: true
@ -308,8 +308,8 @@ RSpec.describe "brew bottle" do
end
end
describe Homebrew do
subject(:homebrew) { described_class }
describe "bottle_cmd" do
subject(:homebrew) { described_class.new(["foo"]) }
let(:hello_hash_big_sur) do
JSON.parse stub_hash(