Formula#old_installed_formula?: fix some bugs
Previously, this method would: - Include the current formula - Include the current target of the installed alias, which by definition is not "old" This commit fixes both of these issues. Only formulae that are the current target of the alias they were installed with are now considered to have old installed formulae.
This commit is contained in:
parent
912b8d4776
commit
e12c23faa8
@ -1186,7 +1186,11 @@ class Formula
|
||||
end
|
||||
|
||||
def old_installed_formulae
|
||||
alias_path ? self.class.installed_with_alias_path(alias_path) : []
|
||||
# If this formula isn't the current target of the alias,
|
||||
# it doesn't make sense to say that other formulae are older versions of it
|
||||
# because we don't know which came first.
|
||||
return [] if alias_path.nil? || installed_alias_target_changed?
|
||||
self.class.installed_with_alias_path(alias_path) - [self]
|
||||
end
|
||||
|
||||
# @private
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user