From ffc47388bd243267ea4c1dc24f58c782f5c42428 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 6 Aug 2017 12:30:40 +0200 Subject: Fix `Pkg#uninstall` not calling `MacOS.undeletable?` for all files. --- Library/Homebrew/cask/lib/hbc/pkg.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Library/Homebrew/cask/lib') diff --git a/Library/Homebrew/cask/lib/hbc/pkg.rb b/Library/Homebrew/cask/lib/hbc/pkg.rb index c9aa3180f..8938268a2 100644 --- a/Library/Homebrew/cask/lib/hbc/pkg.rb +++ b/Library/Homebrew/cask/lib/hbc/pkg.rb @@ -16,19 +16,17 @@ module Hbc def uninstall unless pkgutil_bom_files.empty? odebug "Deleting pkg files" - @command.run("/usr/bin/xargs", args: ["-0", "--", "/bin/rm", "--"], input: pkgutil_bom_files.join("\0"), sudo: true) + @command.run!("/usr/bin/xargs", args: ["-0", "--", "/bin/rm", "--"], input: pkgutil_bom_files.join("\0"), sudo: true) end unless pkgutil_bom_specials.empty? odebug "Deleting pkg symlinks and special files" - @command.run("/usr/bin/xargs", args: ["-0", "--", "/bin/rm", "--"], input: pkgutil_bom_specials.join("\0"), sudo: true) + @command.run!("/usr/bin/xargs", args: ["-0", "--", "/bin/rm", "--"], input: pkgutil_bom_specials.join("\0"), sudo: true) end unless pkgutil_bom_dirs.empty? odebug "Deleting pkg directories" deepest_path_first(pkgutil_bom_dirs).each do |dir| - next if MacOS.undeletable?(dir) - with_full_permissions(dir) do clean_broken_symlinks(dir) clean_ds_store(dir) @@ -67,6 +65,7 @@ module Hbc .stdout .split("\n") .map { |path| root.join(path) } + .reject(&MacOS.public_method(:undeletable?)) end def root -- cgit v1.2.3