aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2013-06-26 10:37:09 -0700
committerAdam Vandenberg2013-06-26 19:58:08 -0700
commit81cc136f343eb01648c54eab8734152593f7a2a1 (patch)
treefaba3df6a5c0af5440b182b4ce2e3055ad76157a
parent03c3ea547a0934718e8c07cb223aa11eebbe8707 (diff)
downloadhomebrew-81cc136f343eb01648c54eab8734152593f7a2a1.tar.bz2
Be explicit about passing formulae names or instances to Tab
-rw-r--r--Library/Homebrew/cmd/doctor.rb2
-rw-r--r--Library/Homebrew/formula_installer.rb2
-rw-r--r--Library/Homebrew/tab.rb5
3 files changed, 6 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 6c64a61ce..ad8892baa 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 5a5ded9d9..30059acba 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 29655b221..a55df156d 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