Skip to content

Commit

Permalink
Fix visibility modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Apr 17, 2023
1 parent 7fdd75a commit cd12c5f
Showing 1 changed file with 44 additions and 46 deletions.
90 changes: 44 additions & 46 deletions Library/Homebrew/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,43 +56,6 @@ def check_prefix
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,
Expand Down Expand Up @@ -342,15 +305,6 @@ def install_formulae(
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?

Expand All @@ -360,6 +314,50 @@ def print_dry_run_dependencies(formula, dependencies, &block)
puts formula_names.join(" ")
end
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

Expand Down

0 comments on commit cd12c5f

Please sign in to comment.