From a600262f681f610b01b1343b80cd8162834a3b45 Mon Sep 17 00:00:00 2001 From: John Zeringue Date: Mon, 18 Jan 2016 08:45:58 +0000 Subject: [PATCH] formula: output recommended/optional deps in JSON. Fixes Homebrew/homebrew#47914 by distinguishing between required, optional, and recommended dependencies when using `brew info --json=v1`. This is done by adding the `optional_dependencies` and `recommended_dependencies` fields to the JSON output. A good example of this fix is `brew info --json=v1 dtrx`. Closes Homebrew/homebrew#48196. Signed-off-by: Mike McQuaid --- Library/Homebrew/formula.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 884385996f..3d8e26f444 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1244,6 +1244,8 @@ class Formula "outdated" => outdated?, "keg_only" => keg_only?, "dependencies" => deps.map(&:name).uniq, + "recommended_dependencies" => deps.select(&:recommended?).map(&:name).uniq, + "optional_dependencies" => deps.select(&:optional?).map(&:name).uniq, "conflicts_with" => conflicts.map(&:name), "caveats" => caveats }