diff options
| author | Vlad Shablinsky | 2016-09-01 17:31:28 +0300 |
|---|---|---|
| committer | Vlad Shablinsky | 2016-09-01 17:46:28 +0300 |
| commit | 6cff426b4f3bee3c618b38fb0ff21e97676b82e1 (patch) | |
| tree | 887915faa063d98d9a2ca36cefaf72e6b3e6c859 /Library | |
| parent | 6622b565ee38de1cd97f5c7b20fa62b481a1ec9b (diff) | |
| download | brew-6cff426b4f3bee3c618b38fb0ff21e97676b82e1.tar.bz2 | |
formula: pinned keg is not eligible for cleanup
If formula is pinned it shouldn't be eligible for cleanup.
Otherwise we can encounter the following behaviour:
1. Install <formula>
2. Pin <formula>
3. <formula> gets outdated
4. Install <other_formula> that depends on <formula>, which requires
up-to-date installation of <formula>. Thus, <formula> gets updated.
5. Now, if we cleanup <formula> we don't remove pin, so it points to
the keg which doesn't exist any longer. The right behaviour is not
to cleanup pinned kegs, which is done in this commit.
Also see #831 for further info.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 3565b8163..9e7bd21ca 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1611,6 +1611,8 @@ class Formula eligible_kegs.each do |keg| if keg.linked? opoo "Skipping (old) #{keg} due to it being linked" + elsif pinned? && keg == Keg.new(@pin.path.resolved_path) + opoo "Skipping (old) #{keg} due to it being pinned" else eligible_for_cleanup << keg end |
