Merge pull request #10927 from Bo98/fi-deprecated-disabled
formula_installer: move deprecation/disabled checking earlier
This commit is contained in:
commit
679dbea79f
@ -179,6 +179,24 @@ class FormulaInstaller
|
||||
|
||||
sig { void }
|
||||
def prelude
|
||||
type, reason = DeprecateDisable.deprecate_disable_info formula
|
||||
if type.present?
|
||||
case type
|
||||
when :deprecated
|
||||
if reason.present?
|
||||
opoo "#{formula.full_name} has been deprecated because it #{reason}!"
|
||||
else
|
||||
opoo "#{formula.full_name} has been deprecated!"
|
||||
end
|
||||
when :disabled
|
||||
if reason.present?
|
||||
raise CannotInstallFormulaError, "#{formula.full_name} has been disabled because it #{reason}!"
|
||||
end
|
||||
|
||||
raise CannotInstallFormulaError, "#{formula.full_name} has been disabled!"
|
||||
end
|
||||
end
|
||||
|
||||
Tab.clear_cache
|
||||
verify_deps_exist unless ignore_deps?
|
||||
forbidden_license_check
|
||||
@ -248,25 +266,6 @@ class FormulaInstaller
|
||||
end
|
||||
end
|
||||
|
||||
type, reason = DeprecateDisable.deprecate_disable_info formula
|
||||
|
||||
if type.present?
|
||||
case type
|
||||
when :deprecated
|
||||
if reason.present?
|
||||
opoo "#{formula.full_name} has been deprecated because it #{reason}!"
|
||||
else
|
||||
opoo "#{formula.full_name} has been deprecated!"
|
||||
end
|
||||
when :disabled
|
||||
if reason.present?
|
||||
raise CannotInstallFormulaError, "#{formula.full_name} has been disabled because it #{reason}!"
|
||||
end
|
||||
|
||||
raise CannotInstallFormulaError, "#{formula.full_name} has been disabled!"
|
||||
end
|
||||
end
|
||||
|
||||
return if ignore_deps?
|
||||
|
||||
if Homebrew::EnvConfig.developer?
|
||||
|
Loading…
x
Reference in New Issue
Block a user