uses: fix --installed with outdated versions
With that option iterate only over `Formula.installed`, otherwise iterate over `Formula`. This is faster than iterating over all the formulae and checking if it's installed. Fixes Homebrew/homebrew#27259. Closes Homebrew/homebrew#27295. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
f155b0570e
commit
342ed1d163
@ -8,13 +8,12 @@ module Homebrew extend self
|
||||
def uses
|
||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||
|
||||
formulae = ARGV.formulae
|
||||
used_formulae = ARGV.formulae
|
||||
formulae = (ARGV.include? "--installed") ? Formula.installed : Formula
|
||||
|
||||
uses = []
|
||||
Formula.each do |f|
|
||||
next if ARGV.include? "--installed" and not f.installed?
|
||||
|
||||
formulae.all? do |ff|
|
||||
formulae.each do |f|
|
||||
used_formulae.all? do |ff|
|
||||
if ARGV.flag? '--recursive'
|
||||
if f.recursive_dependencies.any? { |dep| dep.name == ff.name }
|
||||
uses << f.to_s
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user