From 6cff426b4f3bee3c618b38fb0ff21e97676b82e1 Mon Sep 17 00:00:00 2001 From: Vlad Shablinsky Date: Thu, 1 Sep 2016 17:31:28 +0300 Subject: 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 2. Pin 3. gets outdated 4. Install that depends on , which requires up-to-date installation of . Thus, gets updated. 5. Now, if we cleanup 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. --- Library/Homebrew/formula.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Library') 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 -- cgit v1.2.3