linkage: test all kegs if none are specified

This commit is contained in:
Steven Peters 2018-08-03 11:15:58 -07:00
parent cbd12074dd
commit b387c09d0d
3 changed files with 20 additions and 8 deletions

View File

@ -1,5 +1,5 @@
#: * `linkage` [`--test`] [`--reverse`] <formula>:
#: Checks the library links of an installed formula.
#: * `linkage` [`--test`] [`--reverse`] [<formulae>]:
#: Checks the library links of installed formulae.
#:
#: Only works on installed formulae. An error is raised if it is run on
#: uninstalled formulae.
@ -9,6 +9,8 @@
#:
#: If `--reverse` is passed, print the dylib followed by the binaries
#: which link to it for each library the keg references.
#:
#: If <formulae> are given, check linkage for only the specified brews.
require "cache_store"
require "linkage_checker"
@ -26,8 +28,13 @@ module Homebrew
end
CacheStoreDatabase.use(:linkage) do |db|
ARGV.kegs.each do |keg|
ohai "Checking #{keg.name} linkage" if ARGV.kegs.size > 1
kegs = if ARGV.kegs.empty?
Formula.installed.collect(&:opt_or_installed_prefix_keg).reject(&:nil?)
else
ARGV.kegs
end
kegs.each do |keg|
ohai "Checking #{keg.name} linkage" if kegs.size > 1
result = LinkageChecker.new(keg, cache_db: db)

View File

@ -799,8 +799,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--pry` is passed or HOMEBREW_PRY is set, pry will be
used instead of irb.
* `linkage` [`--test`] [`--reverse`] `formula`:
Checks the library links of an installed formula.
* `linkage` [`--test`] [`--reverse`] [`formulae`]:
Checks the library links of installed formulae.
Only works on installed formulae. An error is raised if it is run on
uninstalled formulae.
@ -811,6 +811,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--reverse` is passed, print the dylib followed by the binaries
which link to it for each library the keg references.
If `formulae` are given, check linkage for only the specified brews.
* `man` [`--fail-if-changed`]:
Generate Homebrew's manpages.

View File

@ -738,8 +738,8 @@ Enter the interactive Homebrew Ruby shell\.
If \fB\-\-examples\fR is passed, several examples will be shown\. If \fB\-\-pry\fR is passed or HOMEBREW_PRY is set, pry will be used instead of irb\.
.
.TP
\fBlinkage\fR [\fB\-\-test\fR] [\fB\-\-reverse\fR] \fIformula\fR
Checks the library links of an installed formula\.
\fBlinkage\fR [\fB\-\-test\fR] [\fB\-\-reverse\fR] [\fIformulae\fR]
Checks the library links of installed formulae\.
.
.IP
Only works on installed formulae\. An error is raised if it is run on uninstalled formulae\.
@ -750,6 +750,9 @@ If \fB\-\-test\fR is passed, only display missing libraries and exit with a non\
.IP
If \fB\-\-reverse\fR is passed, print the dylib followed by the binaries which link to it for each library the keg references\.
.
.IP
If \fIformulae\fR are given, check linkage for only the specified brews\.
.
.TP
\fBman\fR [\fB\-\-fail\-if\-changed\fR]
Generate Homebrew\'s manpages\.