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.
This commit is contained in:
Mike McQuaid 2017-06-07 15:28:22 +01:00
parent cfc40196f2
commit 838bb38b3e

View File

@ -66,6 +66,7 @@ module Homebrew
return unless path.directory? return unless path.directory?
keg.rmtree if keg.exist?
path.rename keg path.rename keg
keg.link unless formula.keg_only? keg.link unless formula.keg_only?
end end