Merge pull request #16439 from arianf/fix-non-ghcr

Fixes `openjdk_dep_name_if_applicable` when not using `CurlGitHubPackagesDownloadStrategy`
This commit is contained in:
Mike McQuaid 2024-01-31 11:43:28 +00:00 committed by GitHub
commit 3707c90ce1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 48 additions and 1 deletions

View File

@ -13,4 +13,44 @@ describe Utils::Bottles do
end end
end 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 end

View File

@ -116,7 +116,14 @@ module Utils
tab_json = bottle_hash[formula.full_name]["bottle"]["tags"][tag]["tab"].to_json tab_json = bottle_hash[formula.full_name]["bottle"]["tags"][tag]["tab"].to_json
Tab.from_file_content(tab_json, tabfile) Tab.from_file_content(tab_json, tabfile)
else 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
end end