diff options
| author | Alyssa Ross | 2016-09-18 23:59:55 +0100 |
|---|---|---|
| committer | Alyssa Ross | 2016-09-18 23:59:55 +0100 |
| commit | e12c23faa87aa9c6f493dcd4aa47d1124c41a418 (patch) | |
| tree | 13fb0b3984f51e0293cc5f6ffb1c2eff03fc4374 /Library | |
| parent | 912b8d47767d4f963cae9e9698e29590d9d9d69b (diff) | |
| download | brew-e12c23faa87aa9c6f493dcd4aa47d1124c41a418.tar.bz2 | |
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.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula.rb | 6 |
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 |
