Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Commit

Permalink
Hotfix for filtered_args breaking brew upgrade
Browse files Browse the repository at this point in the history
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 #8576.
  • Loading branch information
Sharpie committed Nov 14, 2011
1 parent 4afc054 commit e59cc08
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Library/Homebrew/formula_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,16 @@ def check_m4
def filtered_args
# Did the user actually pass the formula this installer is considering on
# 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

args = ARGV.clone
Expand Down

0 comments on commit e59cc08

Please sign in to comment.