Hotfix for filtered_args breaking brew upgrade
The `filtered_args` method added to the `FormulaInstaller` makes a call `ARGV.formulae`. Unfortunately, `ARGV.formulae` will throw a `FormulaUnspecifiedError` instead of returning an empty list. This patch avoids the issue by checking `ARGV.named.empty?` before calling `ARGV.formulae`. Fixes Homebrew/homebrew#8576.
This commit is contained in:
parent
9e5c0da85b
commit
8ec2d8e043
@ -247,7 +247,16 @@ class FormulaInstaller
|
|||||||
def filtered_args
|
def filtered_args
|
||||||
# Did the user actually pass the formula this installer is considering on
|
# Did the user actually pass the formula this installer is considering on
|
||||||
# the command line?
|
# the command line?
|
||||||
def explicitly_requested?; ARGV.formulae.include? f end
|
def explicitly_requested?
|
||||||
|
# `ARGV.formulae` will throw an exception if it comes up with an empty
|
||||||
|
# list.
|
||||||
|
#
|
||||||
|
# FIXME:
|
||||||
|
# `ARGV.formulae` probably should be throwing exceptions, it should be
|
||||||
|
# the caller's responsibility to check `ARGV.formulae.empty?`.
|
||||||
|
return false if ARGV.named.empty?
|
||||||
|
ARGV.formulae.include? f
|
||||||
|
end
|
||||||
previous_install = Tab.for_formula f
|
previous_install = Tab.for_formula f
|
||||||
|
|
||||||
args = ARGV.clone
|
args = ARGV.clone
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user