use ObserverPathnameExtension to remove these files
This commit is contained in:
parent
557f887f24
commit
929fd44082
@ -17,16 +17,14 @@ class Cleaner
|
|||||||
|
|
||||||
# Many formulae include 'lib/charset.alias', but it is not strictly needed
|
# Many formulae include 'lib/charset.alias', but it is not strictly needed
|
||||||
# and will conflict if more than one formula provides it
|
# and will conflict if more than one formula provides it
|
||||||
alias_path = @f.lib/'charset.alias'
|
observe_file_removal @f.lib/'charset.alias'
|
||||||
alias_path.extend(ObserverPathnameExtension).unlink if alias_path.exist?
|
|
||||||
|
|
||||||
[@f.bin, @f.sbin, @f.lib].select{ |d| d.exist? }.each{ |d| clean_dir d }
|
[@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
|
# Get rid of any info 'dir' files, so they don't conflict at the link stage
|
||||||
info_dir_file = @f.info + 'dir'
|
info_dir_file = @f.info + 'dir'
|
||||||
if info_dir_file.file? and not @f.skip_clean? info_dir_file
|
if info_dir_file.file? and not @f.skip_clean? info_dir_file
|
||||||
puts "rm #{info_dir_file}" if ARGV.verbose?
|
observe_file_removal info_dir_file
|
||||||
info_dir_file.unlink
|
|
||||||
end
|
end
|
||||||
|
|
||||||
prune
|
prune
|
||||||
@ -34,6 +32,10 @@ class Cleaner
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def observe_file_removal path
|
||||||
|
path.extend(ObserverPathnameExtension).unlink if path.exist?
|
||||||
|
end
|
||||||
|
|
||||||
# Removes any empty directories in the formula's prefix subtree
|
# Removes any empty directories in the formula's prefix subtree
|
||||||
# Keeps any empty directions projected by skip_clean
|
# Keeps any empty directions projected by skip_clean
|
||||||
def prune
|
def prune
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user