From 7ddd3977d829c63457f3a7aa254fe97ad4f0ce41 Mon Sep 17 00:00:00 2001
From: Steven Peters
Date: Thu, 25 Aug 2016 22:30:43 -0700
Subject: cmd/deps.rb add --full-name option
Add --full-name option to brew deps command,
which displays the full name of dependencies.
---
Library/Homebrew/cmd/deps.rb | 10 ++++++++--
share/doc/homebrew/brew.1.html | 4 +++-
share/man/man1/brew.1 | 5 ++++-
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb
index dfdd2d9f8..738023a88 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`] :
+#: * `deps` [`--1`] [`-n`] [`--union`] [`--full-name`] [`--installed`] [`--include-build`] [`--include-optional`] [`--skip-recommended`] :
#: Show dependencies for . When given multiple formula arguments,
#: show the intersection of dependencies for .
#:
@@ -10,6 +10,8 @@
#: If `--union` is passed, show the union of dependencies for ,
#: 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
+ if ARGV.include? "--full-name"
+ all_deps = all_deps.map(&:to_formula).map(&:full_name).uniq
+ else
+ all_deps = all_deps.map(&:name).uniq
+ end
all_deps.sort! unless mode.topo_order?
puts all_deps
end
diff --git a/share/doc/homebrew/brew.1.html b/share/doc/homebrew/brew.1.html
index d768844b5..7716a5abc 100644
--- a/share/doc/homebrew/brew.1.html
+++ b/share/doc/homebrew/brew.1.html
@@ -100,7 +100,7 @@ you to explicitly set the name and version of the package you are creating.
The option --tap takes a tap as its argument and generates the formula in
the specified tap.
-deps [--1] [-n] [--union] [--installed] [--include-build] [--include-optional] [--skip-recommended] formulaeShow dependencies for formulae. When given multiple formula arguments,
+
deps [--1] [-n] [--union] [--full-name] [--installed] [--include-build] [--include-optional] [--skip-recommended] formulaeShow dependencies for formulae. When given multiple formula arguments,
show the intersection of dependencies for formulae.
If --1 is passed, only show dependencies one level down, instead of
@@ -111,6 +111,8 @@ recursing.
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.
diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1
index 258bbff57..ddd1f23ce 100644
--- a/share/man/man1/brew.1
+++ b/share/man/man1/brew.1
@@ -132,7 +132,7 @@ The options \fB\-\-set\-name\fR and \fB\-\-set\-version\fR each take an argument
The option \fB\-\-tap\fR takes a tap as its argument and generates the formula in the specified tap\.
.
.TP
-\fBdeps\fR [\fB\-\-1\fR] [\fB\-n\fR] [\fB\-\-union\fR] [\fB\-\-installed\fR] [\fB\-\-include\-build\fR] [\fB\-\-include\-optional\fR] [\fB\-\-skip\-recommended\fR] \fIformulae\fR
+\fBdeps\fR [\fB\-\-1\fR] [\fB\-n\fR] [\fB\-\-union\fR] [\fB\-\-full\-name\fR] [\fB\-\-installed\fR] [\fB\-\-include\-build\fR] [\fB\-\-include\-optional\fR] [\fB\-\-skip\-recommended\fR] \fIformulae\fR
Show dependencies for \fIformulae\fR\. When given multiple formula arguments, show the intersection of dependencies for \fIformulae\fR\.
.
.IP
@@ -145,6 +145,9 @@ If \fB\-n\fR is passed, show dependencies in topological order\.
If \fB\-\-union\fR is passed, show the union of dependencies for \fIformulae\fR, instead of the intersection\.
.
.IP
+If \fB\-\-full\-name\fR is passed, list dependencies by their full name\.
+.
+.IP
If \fB\-\-installed\fR is passed, only list those dependencies that are currently installed\.
.
.IP
--
cgit v1.2.3
From bcdd20a165d168f5140d5a8ce9bd83d74e11056e Mon Sep 17 00:00:00 2001
From: Steven Peters
Date: Thu, 25 Aug 2016 22:35:21 -0700
Subject: test-bot: use --full-name in brew deps invocation
This allows changed formulae in taps to be tested in the proper order.
See #738 for more details.
---
Library/Homebrew/dev-cmd/test-bot.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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|
--
cgit v1.2.3
From 6f3039fcd3a2bb8ad7de52359a70f60aeac52ce8 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Tue, 30 Aug 2016 18:49:27 +0100
Subject: cmd/deps: avoid some full-name code repetition.
---
Library/Homebrew/cmd/deps.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb
index 738023a88..8db70461e 100644
--- a/Library/Homebrew/cmd/deps.rb
+++ b/Library/Homebrew/cmd/deps.rb
@@ -64,11 +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?
- if ARGV.include? "--full-name"
- all_deps = all_deps.map(&:to_formula).map(&:full_name).uniq
+ all_deps = if ARGV.include? "--full-name"
+ all_deps.map(&:to_formula).map(&:full_name)
else
- all_deps = all_deps.map(&:name).uniq
- end
+ all_deps.map(&:name)
+ end.uniq
all_deps.sort! unless mode.topo_order?
puts all_deps
end
--
cgit v1.2.3