Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes openjdk_dep_name_if_applicable when not using CurlGitHubPackagesDownloadStrategy #16439

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 40 additions & 0 deletions Library/Homebrew/test/utils/bottles/bottles_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,44 @@
end
end
end

describe ".load_tab" do
context "when tab_attributes and tabfile are missing" do
before do
# setup a testball1
dep_name = "testball1"
dep_path = CoreTap.new.new_formula_path(dep_name)
dep_path.write <<~RUBY
class #{Formulary.class_s(dep_name)} < Formula
url "testball1"
version "0.1"
end
RUBY
Formulary.cache.delete(dep_path)

# setup a testball2, that depends on testball1
formula_name = "testball2"
formula_path = CoreTap.new.new_formula_path(formula_name)
formula_path.write <<~RUBY
class #{Formulary.class_s(formula_name)} < Formula
url "testball2"
version "0.1"
depends_on "testball1"
end
RUBY
Formulary.cache.delete(formula_path)
end

it "includes runtime_dependencies" do
formula = Formula["testball2"]
formula.prefix.mkpath

runtime_dependencies = described_class.load_tab(formula).runtime_dependencies

expect(runtime_dependencies).not_to be_nil
expect(runtime_dependencies.size).to eq(1)
expect(runtime_dependencies.first).to include("full_name" => "testball1")
end
end
end
end
9 changes: 8 additions & 1 deletion Library/Homebrew/utils/bottles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,14 @@ def load_tab(formula)
tab_json = bottle_hash[formula.full_name]["bottle"]["tags"][tag]["tab"].to_json
Tab.from_file_content(tab_json, tabfile)
else
Tab.for_keg(keg)
tab = Tab.for_keg(keg)

tab.runtime_dependencies = begin
f_runtime_deps = formula.runtime_dependencies(read_from_tab: false)
Tab.runtime_deps_hash(formula, f_runtime_deps)
end

tab
end
end

Expand Down