Move FormulaInstaller check to extend/os
This commit is contained in:
parent
2eee1e7c2a
commit
d48859a9ce
8
Library/Homebrew/extend/os/formula_installer.rb
Normal file
8
Library/Homebrew/extend/os/formula_installer.rb
Normal file
@ -0,0 +1,8 @@
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
if OS.mac?
|
||||
require "extend/os/mac/formula_installer"
|
||||
elsif OS.linux?
|
||||
require "extend/os/linux/formula_installer"
|
||||
end
|
||||
12
Library/Homebrew/extend/os/linux/formula_installer.rb
Normal file
12
Library/Homebrew/extend/os/linux/formula_installer.rb
Normal file
@ -0,0 +1,12 @@
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
class FormulaInstaller
|
||||
undef fresh_install?
|
||||
|
||||
sig { params(formula: Formula).returns(T.nilable(T::Boolean)) }
|
||||
def fresh_install?(formula)
|
||||
!Homebrew::EnvConfig.developer? &&
|
||||
(!installed_as_dependency? || !formula.any_version_installed?)
|
||||
end
|
||||
end
|
||||
12
Library/Homebrew/extend/os/mac/formula_installer.rb
Normal file
12
Library/Homebrew/extend/os/mac/formula_installer.rb
Normal file
@ -0,0 +1,12 @@
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
class FormulaInstaller
|
||||
undef fresh_install?
|
||||
|
||||
sig { params(formula: Formula).returns(T.nilable(T::Boolean)) }
|
||||
def fresh_install?(formula)
|
||||
!Homebrew::EnvConfig.developer? && !OS::Mac.version.outdated_release? &&
|
||||
(!installed_as_dependency? || !formula.any_version_installed?)
|
||||
end
|
||||
end
|
||||
@ -258,9 +258,7 @@ class FormulaInstaller
|
||||
# don't want to complain about no bottle available if doing an
|
||||
# upgrade/reinstall/dependency install (but do in the case the bottle
|
||||
# check fails)
|
||||
elsif !Homebrew::EnvConfig.developer? &&
|
||||
(!installed_as_dependency? || !formula.any_version_installed?) &&
|
||||
(!OS.mac? || !OS::Mac.version.outdated_release?)
|
||||
elsif fresh_install?(formula)
|
||||
<<~EOS
|
||||
#{formula}: no bottle available!
|
||||
EOS
|
||||
@ -343,6 +341,11 @@ class FormulaInstaller
|
||||
"#{formula.full_name} requires the latest version of pinned dependencies"
|
||||
end
|
||||
|
||||
sig { params(_formula: Formula).returns(T.nilable(T::Boolean)) }
|
||||
def fresh_install?(_formula)
|
||||
false
|
||||
end
|
||||
|
||||
sig { void }
|
||||
def install_fetch_deps
|
||||
return if @compute_dependencies.blank?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user