aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 5368941f7..795646d08 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -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