Skip to content

Commit

Permalink
dependency: fix missed upgrades when an alias is changed to a formula
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Jul 18, 2024
1 parent 772149d commit c3ae032
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Library/Homebrew/dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,16 @@ def installed?(minimum_version: nil, minimum_revision: nil)

return false if minimum_version.blank?

installed_version = formula.any_installed_version
return false unless installed_version
# If the opt prefix doesn't exist: we likely have an incomplete installation.
return false unless formula.opt_prefix.exist?

installed_keg = formula.any_installed_keg
return false unless installed_keg

# If the keg name doesn't match, we may have moved from an alias to a full formula and need to upgrade.
return false unless formula.possible_names.include?(installed_keg.name)

installed_version = installed_keg.version

# 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
Expand Down

0 comments on commit c3ae032

Please sign in to comment.