aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorCharlie Sharpsteen2011-11-14 08:22:59 -0800
committerCharlie Sharpsteen2011-11-14 08:22:59 -0800
commit8ec2d8e04396caee709e475fbbcad46dc6f9146f (patch)
tree266e6f83f9dd5f868dba1e9d55deb75879938ff2 /Library
parent9e5c0da85ba4d0b66acb73af0c335db94389d724 (diff)
downloadbrew-8ec2d8e04396caee709e475fbbcad46dc6f9146f.tar.bz2
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.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula_installer.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 537cbd317..689c4ff68 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -247,7 +247,16 @@ class FormulaInstaller
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