From 95bea08a3b95450e69912798612307e2951c3d37 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Mon, 17 Apr 2023 11:02:59 -0700 Subject: [PATCH] Fix visibility modifiers --- Library/Homebrew/install.rb | 90 ++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 46 deletions(-) diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index a67a8297d4..47cf8084be 100644 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -56,43 +56,6 @@ module Homebrew end end - def check_cpu - return unless Hardware::CPU.ppc? - - odie <<~EOS - Sorry, Homebrew does not support your computer's CPU architecture! - For PowerPC Mac (PPC32/PPC64BE) support, see: - #{Formatter.url("https://github.com/mistydemeo/tigerbrew")} - EOS - end - private_class_method :check_cpu - - def attempt_directory_creation - Keg::MUST_EXIST_DIRECTORIES.each do |dir| - FileUtils.mkdir_p(dir) unless dir.exist? - - # Create these files to ensure that these directories aren't removed - # by the Catalina installer. - # (https://github.com/Homebrew/brew/issues/6263) - keep_file = dir/".keepme" - FileUtils.touch(keep_file) unless keep_file.exist? - rescue - nil - end - end - private_class_method :attempt_directory_creation - - def check_cc_argv(cc) - return unless cc - - @checks ||= Diagnostic::Checks.new - opoo <<~EOS - You passed `--cc=#{cc}`. - #{@checks.please_create_pull_requests} - EOS - end - private_class_method :check_cc_argv - def install_formula?( formula, head: false, @@ -342,15 +305,6 @@ module Homebrew end end - def install_formula(formula_installer) - formula = formula_installer.formula - - upgrade = formula.linked? && formula.outdated? && !formula.head? && !Homebrew::EnvConfig.no_install_upgrade? - - Upgrade.install_formula(formula_installer, upgrade: upgrade) - end - private_class_method :install_formula - def print_dry_run_dependencies(formula, dependencies, &block) return if dependencies.empty? @@ -359,6 +313,50 @@ module Homebrew formula_names = dependencies.map(&:first).map(&:to_formula).map(&block) puts formula_names.join(" ") end + + private + + def check_cc_argv(cc) + return unless cc + + @checks ||= Diagnostic::Checks.new + opoo <<~EOS + You passed `--cc=#{cc}`. + #{@checks.please_create_pull_requests} + EOS + end + + def attempt_directory_creation + Keg::MUST_EXIST_DIRECTORIES.each do |dir| + FileUtils.mkdir_p(dir) unless dir.exist? + + # Create these files to ensure that these directories aren't removed + # by the Catalina installer. + # (https://github.com/Homebrew/brew/issues/6263) + keep_file = dir/".keepme" + FileUtils.touch(keep_file) unless keep_file.exist? + rescue + nil + end + end + + def check_cpu + return unless Hardware::CPU.ppc? + + odie <<~EOS + Sorry, Homebrew does not support your computer's CPU architecture! + For PowerPC Mac (PPC32/PPC64BE) support, see: + #{Formatter.url("https://github.com/mistydemeo/tigerbrew")} + EOS + end + + def install_formula(formula_installer) + formula = formula_installer.formula + + upgrade = formula.linked? && formula.outdated? && !formula.head? && !Homebrew::EnvConfig.no_install_upgrade? + + Upgrade.install_formula(formula_installer, upgrade: upgrade) + end end end end