use ObserverPathnameExtension to remove these files

This commit is contained in:
Adam Vandenberg 2014-07-20 09:54:51 -07:00
parent 557f887f24
commit 929fd44082

View File

@ -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