test-bot: only test the runtime dependencies.
Also add support to `brew uses` to ignore build or optional dependencies. Closes Homebrew/homebrew#36154. Closes Homebrew/homebrew#36656. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
8e12390fc8
commit
105eaf3382
@ -363,7 +363,7 @@ module Homebrew
|
|||||||
unchanged_dependencies = dependencies - @formulae
|
unchanged_dependencies = dependencies - @formulae
|
||||||
changed_dependences = dependencies - unchanged_dependencies
|
changed_dependences = dependencies - unchanged_dependencies
|
||||||
|
|
||||||
dependents = `brew uses #{formula_name}`.split("\n")
|
dependents = `brew uses --skip-build --skip-optional #{formula_name}`.split("\n")
|
||||||
dependents -= @formulae
|
dependents -= @formulae
|
||||||
dependents = dependents.map {|d| Formulary.factory(d)}
|
dependents = dependents.map {|d| Formulary.factory(d)}
|
||||||
|
|
||||||
|
|||||||
@ -11,15 +11,24 @@ module Homebrew
|
|||||||
used_formulae = ARGV.formulae
|
used_formulae = ARGV.formulae
|
||||||
formulae = (ARGV.include? "--installed") ? Formula.installed : Formula
|
formulae = (ARGV.include? "--installed") ? Formula.installed : Formula
|
||||||
recursive = ARGV.flag? "--recursive"
|
recursive = ARGV.flag? "--recursive"
|
||||||
|
ignores = []
|
||||||
|
ignores << "build?" if ARGV.flag? "--skip-build"
|
||||||
|
ignores << "optional?" if ARGV.flag? "--skip-optional"
|
||||||
|
|
||||||
uses = formulae.select do |f|
|
uses = formulae.select do |f|
|
||||||
used_formulae.all? do |ff|
|
used_formulae.all? do |ff|
|
||||||
begin
|
begin
|
||||||
if recursive
|
if recursive
|
||||||
f.recursive_dependencies.any? { |dep| dep.to_formula.name == ff.name } ||
|
deps = f.recursive_dependencies.reject do |dep|
|
||||||
|
ignores.any? { |ignore| dep.send(ignore) }
|
||||||
|
end
|
||||||
|
deps.any? { |dep| dep.to_formula.name == ff.name } ||
|
||||||
f.recursive_requirements.any? { |req| req.name == ff.name }
|
f.recursive_requirements.any? { |req| req.name == ff.name }
|
||||||
else
|
else
|
||||||
f.deps.any? { |dep| dep.to_formula.name == ff.name } ||
|
deps = f.deps.reject do |dep|
|
||||||
|
ignores.any? { |ignore| dep.send(ignore) }
|
||||||
|
end
|
||||||
|
deps.any? { |dep| dep.to_formula.name == ff.name } ||
|
||||||
f.requirements.any? { |req| req.name == ff.name }
|
f.requirements.any? { |req| req.name == ff.name }
|
||||||
end
|
end
|
||||||
rescue FormulaUnavailableError => e
|
rescue FormulaUnavailableError => e
|
||||||
|
|||||||
@ -398,7 +398,7 @@ Note that these flags should only appear after a command.
|
|||||||
If <formulae> are given, upgrade only the specified brews (but do so even
|
If <formulae> are given, upgrade only the specified brews (but do so even
|
||||||
if they are pinned; see `pin`, `unpin`).
|
if they are pinned; see `pin`, `unpin`).
|
||||||
|
|
||||||
* `uses [--installed] [--recursive] [--devel|--HEAD]` <formulae>:
|
* `uses [--installed] [--recursive] [--skip-build] [--skip-optional] [--devel|--HEAD]` <formulae>:
|
||||||
Show the formulae that specify <formulae> as a dependency. When given
|
Show the formulae that specify <formulae> as a dependency. When given
|
||||||
multiple formula arguments, show the intersection of formulae that use
|
multiple formula arguments, show the intersection of formulae that use
|
||||||
<formulae>.
|
<formulae>.
|
||||||
@ -407,6 +407,10 @@ Note that these flags should only appear after a command.
|
|||||||
|
|
||||||
If `--installed` is passed, only list installed formulae.
|
If `--installed` is passed, only list installed formulae.
|
||||||
|
|
||||||
|
By default, `uses` shows all formulae that specify <formulae> as a dependency.
|
||||||
|
To skip the `:build` type dependencies, pass `--skip-build`. Similarly, pass
|
||||||
|
`--skip-optional` to skip `:optional` dependencies.
|
||||||
|
|
||||||
By default, `uses` shows usages of `formula` by stable builds. To find
|
By default, `uses` shows usages of `formula` by stable builds. To find
|
||||||
cases where `formula` is used by development or HEAD build, pass
|
cases where `formula` is used by development or HEAD build, pass
|
||||||
`--devel` or `--HEAD`.
|
`--devel` or `--HEAD`.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
.\" generated with Ronn/v0.7.3
|
.\" generated with Ronn/v0.7.3
|
||||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||||
.
|
.
|
||||||
.TH "BREW" "1" "January 2015" "Homebrew" "brew"
|
.TH "BREW" "1" "February 2015" "Homebrew" "brew"
|
||||||
.
|
.
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
\fBbrew\fR \- The missing package manager for OS X
|
\fBbrew\fR \- The missing package manager for OS X
|
||||||
@ -426,7 +426,7 @@ Options for the \fBinstall\fR command are also valid here\.
|
|||||||
If \fIformulae\fR are given, upgrade only the specified brews (but do so even if they are pinned; see \fBpin\fR, \fBunpin\fR)\.
|
If \fIformulae\fR are given, upgrade only the specified brews (but do so even if they are pinned; see \fBpin\fR, \fBunpin\fR)\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fBuses [\-\-installed] [\-\-recursive] [\-\-devel|\-\-HEAD]\fR \fIformulae\fR
|
\fBuses [\-\-installed] [\-\-recursive] [\-\-skip\-build] [\-\-skip\-optional] [\-\-devel|\-\-HEAD]\fR \fIformulae\fR
|
||||||
Show the formulae that specify \fIformulae\fR as a dependency\. When given multiple formula arguments, show the intersection of formulae that use \fIformulae\fR\.
|
Show the formulae that specify \fIformulae\fR as a dependency\. When given multiple formula arguments, show the intersection of formulae that use \fIformulae\fR\.
|
||||||
.
|
.
|
||||||
.IP
|
.IP
|
||||||
@ -436,6 +436,9 @@ Use \fB\-\-recursive\fR to resolve more than one level of dependencies\.
|
|||||||
If \fB\-\-installed\fR is passed, only list installed formulae\.
|
If \fB\-\-installed\fR is passed, only list installed formulae\.
|
||||||
.
|
.
|
||||||
.IP
|
.IP
|
||||||
|
By default, \fBuses\fR shows all formulae that specify \fIformulae\fR as a dependency\. To skip the \fB:build\fR type dependencies, pass \fB\-\-skip\-build\fR\. Similarly, pass \fB\-\-skip\-optional\fR to skip \fB:optional\fR dependencies\.
|
||||||
|
.
|
||||||
|
.IP
|
||||||
By default, \fBuses\fR shows usages of \fBformula\fR by stable builds\. To find cases where \fBformula\fR is used by development or HEAD build, pass \fB\-\-devel\fR or \fB\-\-HEAD\fR\.
|
By default, \fBuses\fR shows usages of \fBformula\fR by stable builds\. To find cases where \fBformula\fR is used by development or HEAD build, pass \fB\-\-devel\fR or \fB\-\-HEAD\fR\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user