From 541305ae98a5b79cb93f14d64aea250205ccde6e Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Fri, 26 Apr 2024 23:49:39 -0700 Subject: [PATCH] Update internal json v3 formula tests --- Library/Homebrew/formulary.rb | 4 +- .../internal_tap_json/homebrew-core.json | 49 ++++++++++--------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 86ca772cd8646..a11220a0624d8 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -216,7 +216,7 @@ def self.load_formula_from_api(name, flags:) T.bind(self, SoftwareSpec) deps&.each do |name, info| - tags = case info["tags"] + tags = case info&.dig("tags") in Array => tag_list tag_list.map(&:to_sym) in String => tag @@ -225,7 +225,7 @@ def self.load_formula_from_api(name, flags:) nil end - if info.key?("uses_from_macos") + if info&.key?("uses_from_macos") bounds = info["uses_from_macos"] || {} bounds.deep_transform_keys!(&:to_sym) bounds.deep_transform_values!(&:to_sym) diff --git a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core.json b/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core.json index c823e3973fe6f..9074219a04951 100644 --- a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core.json +++ b/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core.json @@ -32,9 +32,6 @@ "post_install_defined": false, "ruby_source_path": "Formula/f/fennel.rb", "ruby_source_sha256": "5856e655fd1cea11496d67bc27fb14fee5cfbdea63c697c3773c7f247581197d", - "dependencies": [ - "lua" - ], "version": "1.4.0", "bottle": { "files": { @@ -43,6 +40,9 @@ "sha256": "f46028597883cbc38864c61bd3fa402da9cb90ce97415d51a7b5279bc17f7bd0" } } + }, + "dependencies": { + "lua": null } }, "ponyc": { @@ -59,25 +59,6 @@ "post_install_defined": false, "ruby_source_path": "Formula/p/ponyc.rb", "ruby_source_sha256": "81d51c25d18710191beb62f9f380bae3d878aad815a65ec1ee2a3b132c1fadb3", - "build_dependencies": [ - "cmake", - "python@3.12" - ], - "uses_from_macos": [ - { - "llvm": [ - "build", - "test" - ] - }, - "zlib" - ], - "uses_from_macos_bounds": [ - { - }, - { - } - ], "version": "0.58.1", "bottle": { "files": { @@ -110,7 +91,29 @@ "sha256": "ab49318d75eed3ee932c8e5add22f252ec0c852aad94945022877f926e93899f" } } + }, + "dependencies": { + "cmake": { + "tags": [ + "build" + ] + }, + "python@3.12": { + "tags": [ + "build" + ] + }, + "llvm": { + "tags": [ + "build", + "test" + ], + "uses_from_macos": null + }, + "zlib": { + "uses_from_macos": null + } } } } -} \ No newline at end of file +}