aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2014-07-20 09:54:51 -0700
committerAdam Vandenberg2014-07-20 12:17:06 -0700
commit929fd44082cbbdd3cf90ec34acc86357d22b4647 (patch)
tree90dd482a8dc42196702dbfe948e8808e6a221b30
parent557f887f24254a1423ca43f6111047c837aa364a (diff)
downloadbrew-929fd44082cbbdd3cf90ec34acc86357d22b4647.tar.bz2
use ObserverPathnameExtension to remove these files
-rw-r--r--Library/Homebrew/cleaner.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/Homebrew/cleaner.rb b/Library/Homebrew/cleaner.rb
index e80cdfe92..f0c0b35d5 100644
--- a/Library/Homebrew/cleaner.rb
+++ b/Library/Homebrew/cleaner.rb
@@ -17,16 +17,14 @@ class Cleaner
# Many formulae include 'lib/charset.alias', but it is not strictly needed
# and will conflict if more than one formula provides it
- alias_path = @f.lib/'charset.alias'
- alias_path.extend(ObserverPathnameExtension).unlink if alias_path.exist?
+ observe_file_removal @f.lib/'charset.alias'
[@f.bin, @f.sbin, @f.lib].select{ |d| d.exist? }.each{ |d| clean_dir d }
# Get rid of any info 'dir' files, so they don't conflict at the link stage
info_dir_file = @f.info + 'dir'
if info_dir_file.file? and not @f.skip_clean? info_dir_file
- puts "rm #{info_dir_file}" if ARGV.verbose?
- info_dir_file.unlink
+ observe_file_removal info_dir_file
end
prune
@@ -34,6 +32,10 @@ class Cleaner
private
+ def observe_file_removal path
+ path.extend(ObserverPathnameExtension).unlink if path.exist?
+ end
+
# Removes any empty directories in the formula's prefix subtree
# Keeps any empty directions projected by skip_clean
def prune