From 1cd31496775ab8cf1051e22367c8ab6184bb3b97 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Wed, 26 Jun 2013 10:37:09 -0700 Subject: [PATCH] Be explicit about passing formulae names or instances to Tab --- Library/Homebrew/cmd/doctor.rb | 2 +- Library/Homebrew/formula_installer.rb | 2 +- Library/Homebrew/tab.rb | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 6c64a61ce1..ad8892baab 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -974,7 +974,7 @@ def check_for_non_prefixed_coreutils end def check_for_non_prefixed_findutils - default_names = Tab.for_formula('findutils').used_options.include? 'default-names' + default_names = Tab.for_name('findutils').used_options.include? 'default-names' if default_names then <<-EOS.undent Putting non-prefixed findutils in your path can cause python builds to fail. EOS diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 5a5ded9d90..30059acba0 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -205,7 +205,7 @@ class FormulaInstaller end def install_dependency dep - dep_tab = Tab.for_formula(dep) + dep_tab = Tab.for_formula(dep.to_formula) dep_options = dep.options dep = dep.to_formula diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 29655b221b..a55df156d5 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -42,8 +42,11 @@ class Tab < OpenStruct end end + def self.for_name name + for_formula(Formula.factory(name)) + end + def self.for_formula f - f = Formula.factory(f) path = [f.opt_prefix, f.linked_keg].map{ |pn| pn.join(FILENAME) }.find{ |pn| pn.exist? } # Legacy kegs may lack a receipt. If it doesn't exist, fake one if path.nil? then self.dummy_tab(f) else self.from_file(path) end