From 838bb38b3eeb73a6b37120cdc2c9d4fff9e52ee4 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 7 Jun 2017 15:28:22 +0100 Subject: [PATCH] reinstall: remove partially installed keg. Previously if a `brew reinstall` was Ctrl-Cd after some files had been installed it wouldn't try to remove the partially installed keg and the renaming of the backed-up keg would fail. Alternatively, remove the partially installed keg as if it has been Ctrl-Cd or otherwise failed then it's not desirable to keep it. --- Library/Homebrew/cmd/reinstall.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index 7ba57fd13d..f177c6b5d3 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -66,6 +66,7 @@ module Homebrew return unless path.directory? + keg.rmtree if keg.exist? path.rename keg keg.link unless formula.keg_only? end