upgrade: fix missed upgrades when an alias is changed to a formula
This commit is contained in:
parent
6cfa08333c
commit
993a0aec3a
@ -75,33 +75,8 @@ module Homebrew
|
|||||||
# Don't need to install this bottle if all of the runtime
|
# Don't need to install this bottle if all of the runtime
|
||||||
# dependencies have the same or newer version already installed.
|
# dependencies have the same or newer version already installed.
|
||||||
next if dependents && fi.bottle_tab_runtime_dependencies.presence&.all? do |dependency, hash|
|
next if dependents && fi.bottle_tab_runtime_dependencies.presence&.all? do |dependency, hash|
|
||||||
dependency_formula = begin
|
minimum_version = Version.new(hash["version"]) if hash["version"].present?
|
||||||
Formula[dependency]
|
Dependency.new(dependency).installed?(minimum_version:, minimum_revision: hash["revision"])
|
||||||
rescue FormulaUnavailableError
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
next false if dependency_formula.nil?
|
|
||||||
|
|
||||||
next true if dependency_formula.latest_version_installed?
|
|
||||||
|
|
||||||
installed_version = dependency_formula.any_installed_version
|
|
||||||
next false unless installed_version
|
|
||||||
|
|
||||||
next false if hash["version"].blank?
|
|
||||||
|
|
||||||
# Tabs prior to 4.1.18 did not have revision or pkg_version fields.
|
|
||||||
# As a result, we have to be more conversative when we do not have
|
|
||||||
# a revision in the tab and assume that if the formula has a
|
|
||||||
# the same version and a non-zero revision that it needs upgraded.
|
|
||||||
tab_version = Version.new(hash["version"])
|
|
||||||
if hash["revision"].present?
|
|
||||||
tab_pkg_version = PkgVersion.new(tab_version, hash["revision"])
|
|
||||||
installed_version >= tab_pkg_version
|
|
||||||
elsif installed_version.version == tab_version
|
|
||||||
dependency_formula.revision.zero?
|
|
||||||
else
|
|
||||||
installed_version.version > tab_version
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
fi.fetch
|
fi.fetch
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user