aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2016-08-30 20:17:07 +0100
committerGitHub2016-08-30 20:17:07 +0100
commit8bf787c94d77cc55955949076cc0d77e9b13c76d (patch)
tree89df6e7d49c859e56aa3a253835e10938e4f2e36 /Library
parent8e29cf1b1d39f5d86aaeb702597aa34d97cd763a (diff)
parent6f3039fcd3a2bb8ad7de52359a70f60aeac52ce8 (diff)
downloadbrew-8bf787c94d77cc55955949076cc0d77e9b13c76d.tar.bz2
Merge pull request #830 from scpeters/deps_cmd_full_name
Add `--full-name` option to `brew deps`
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/deps.rb10
-rw-r--r--Library/Homebrew/dev-cmd/test-bot.rb2
2 files changed, 9 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb
index dfdd2d9f8..8db70461e 100644
--- a/Library/Homebrew/cmd/deps.rb
+++ b/Library/Homebrew/cmd/deps.rb
@@ -1,4 +1,4 @@
-#: * `deps` [`--1`] [`-n`] [`--union`] [`--installed`] [`--include-build`] [`--include-optional`] [`--skip-recommended`] <formulae>:
+#: * `deps` [`--1`] [`-n`] [`--union`] [`--full-name`] [`--installed`] [`--include-build`] [`--include-optional`] [`--skip-recommended`] <formulae>:
#: Show dependencies for <formulae>. When given multiple formula arguments,
#: show the intersection of dependencies for <formulae>.
#:
@@ -10,6 +10,8 @@
#: If `--union` is passed, show the union of dependencies for <formulae>,
#: instead of the intersection.
#:
+#: If `--full-name` is passed, list dependencies by their full name.
+#:
#: If `--installed` is passed, only list those dependencies that are
#: currently installed.
#:
@@ -62,7 +64,11 @@ module Homebrew
else
all_deps = deps_for_formulae(ARGV.formulae, !ARGV.one?, &(mode.union? ? :| : :&))
all_deps = all_deps.select(&:installed?) if mode.installed?
- all_deps = all_deps.map(&:name).uniq
+ all_deps = if ARGV.include? "--full-name"
+ all_deps.map(&:to_formula).map(&:full_name)
+ else
+ all_deps.map(&:name)
+ end.uniq
all_deps.sort! unless mode.topo_order?
puts all_deps
end
diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb
index bbd84aa8f..4052daac2 100644
--- a/Library/Homebrew/dev-cmd/test-bot.rb
+++ b/Library/Homebrew/dev-cmd/test-bot.rb
@@ -753,7 +753,7 @@ module Homebrew
changed_formulae_dependents = {}
@formulae.each do |formula|
- formula_dependencies = Utils.popen_read("brew", "deps", "--include-build", formula).split("\n")
+ formula_dependencies = Utils.popen_read("brew", "deps", "--full-name", "--include-build", formula).split("\n")
unchanged_dependencies = formula_dependencies - @formulae
changed_dependences = formula_dependencies - unchanged_dependencies
changed_dependences.each do |changed_formula|