From 82fde4e1e520934635aa9a6212c7954e9d68a134 Mon Sep 17 00:00:00 2001 From: Igor Kapkov Date: Sun, 2 Feb 2020 16:38:50 +0100 Subject: [PATCH 1/2] Add stable url, tag and revision to json output --- Library/Homebrew/formula.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 80eb373512..3fd4117ead 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1626,6 +1626,13 @@ class Formula "head" => head&.version&.to_s, "bottle" => !bottle_specification.checksums.empty?, }, + "urls" => { + "stable" => { + "url" => stable.url, + "tag" => stable.specs&.dig(:tag), + "revision" => stable.specs&.dig(:revision), + }, + }, "revision" => revision, "version_scheme" => version_scheme, "bottle" => {}, From 5ef9b8863a59356395a1bc39904083b531117c97 Mon Sep 17 00:00:00 2001 From: Igor Kapkov Date: Sun, 2 Feb 2020 17:11:29 +0100 Subject: [PATCH 2/2] Move urls code and add devel urls --- Library/Homebrew/formula.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 3fd4117ead..97f5533a3f 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1626,13 +1626,7 @@ class Formula "head" => head&.version&.to_s, "bottle" => !bottle_specification.checksums.empty?, }, - "urls" => { - "stable" => { - "url" => stable.url, - "tag" => stable.specs&.dig(:tag), - "revision" => stable.specs&.dig(:revision), - }, - }, + "urls" => {}, "revision" => revision, "version_scheme" => version_scheme, "bottle" => {}, @@ -1684,6 +1678,11 @@ class Formula } end hsh["bottle"][spec_sym] = bottle_info + hsh["urls"][spec_sym] = { + "url" => spec.url, + "tag" => spec.specs[:tag], + "revision" => spec.specs[:revision], + } end hsh["options"] = options.map do |opt|