diff options
| author | Xu Cheng | 2015-09-25 21:16:17 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-09-26 13:51:56 +0800 |
| commit | 1b33c70d46fa49aae9817d9b8cba9f5b0d34a5d4 (patch) | |
| tree | e6d4f2830fdd7ec97b81c6cc03ec6b3fa36a2669 /Library | |
| parent | 7b97dca554459892f11f7ee28aa7eb12c763a549 (diff) | |
| download | brew-1b33c70d46fa49aae9817d9b8cba9f5b0d34a5d4.tar.bz2 | |
FormulaInstaller: cleanup files when pouring bottle failed
Closes Homebrew/homebrew#44325.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 0ac94a40c..0d9943a07 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -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 |
