FormulaInstaller: cleanup files when pouring bottle failed

Closes Homebrew/homebrew#44325.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Xu Cheng 2015-09-25 21:16:17 +08:00
parent 7b97dca554
commit 1b33c70d46

View File

@ -189,7 +189,12 @@ class FormulaInstaller
begin
install_relocation_tools unless formula.bottle_specification.skip_relocation?
pour
rescue => e
rescue Exception => e
# any exceptions must leave us with nothing installed
ignore_interrupts do
formula.prefix.rmtree if formula.prefix.directory?
formula.rack.rmdir_if_possible
end
raise if ARGV.homebrew_developer?
@pour_failed = true
onoe e.message