From f848a0834487c27ce9608328ab8a4575d3d8fedb Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 8 Jun 2013 15:14:01 -0500 Subject: [PATCH] FormulaInstaller: factor out readline workaround --- Library/Homebrew/formula_installer.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 6f8667c8e5..aca76b492c 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -79,12 +79,7 @@ class FormulaInstaller end unless ignore_deps - # HACK: If readline is present in the dependency tree, it will clash - # with the stdlib's Readline module when the debugger is loaded - if f.recursive_dependencies.any? { |d| d.name == "readline" } and ARGV.debug? - ENV['HOMEBREW_NO_READLINE'] = '1' - end - + perform_readline_hack check_requirements install_dependencies end @@ -118,6 +113,14 @@ class FormulaInstaller opoo "Nothing was installed to #{f.prefix}" unless f.installed? end + # HACK: If readline is present in the dependency tree, it will clash + # with the stdlib's Readline module when the debugger is loaded + def perform_readline_hack + if f.recursive_dependencies.any? { |d| d.name == "readline" } && ARGV.debug? + ENV['HOMEBREW_NO_READLINE'] = '1' + end + end + def check_requirements unsatisfied = ARGV.filter_for_dependencies do f.recursive_requirements do |dependent, req|