FormulaInstaller: factor out readline workaround

This commit is contained in:
Jack Nagel 2013-06-08 15:14:01 -05:00
parent 8cb861c695
commit f848a08344

View File

@ -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|