aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cleaner.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/cleaner.rb')
-rw-r--r--Library/Homebrew/cleaner.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/Library/Homebrew/cleaner.rb b/Library/Homebrew/cleaner.rb
index f19efc23b..070f35b81 100644
--- a/Library/Homebrew/cleaner.rb
+++ b/Library/Homebrew/cleaner.rb
@@ -1,7 +1,7 @@
class Cleaner
def initialize f
- @f=f
- [f.bin, f.sbin, f.lib].select{|d|d.exist?}.each{|d|clean_dir d}
+ @f = Formula.factory f
+ [f.bin, f.sbin, f.lib].select{ |d| d.exist? }.each{ |d| clean_dir d }
unless ENV['HOMEBREW_KEEP_INFO'].nil?
f.info.rmtree if f.info.directory? and not f.skip_clean? f.info
@@ -23,7 +23,8 @@ class Cleaner
end
end
-private
+ private
+
def strip path, args=''
return if @f.skip_clean? path
puts "strip #{path}" if ARGV.verbose?
@@ -46,18 +47,17 @@ private
end
def clean_file path
- perms=0444
+ perms = 0444
case `file -h '#{path}'`
when /Mach-O dynamically linked shared library/
- # Stripping libraries is causing no end of trouble
- # Lets just give up, and try to do it manually in instances where it
- # makes sense
+ # Stripping libraries is causing no end of trouble. Lets just give up,
+ # and try to do it manually in instances where it makes sense.
#strip path, '-SxX'
when /Mach-O [^ ]* ?executable/
strip path
- perms=0555
+ perms = 0555
when /script text executable/
- perms=0555
+ perms = 0555
end
path.chmod perms
end
@@ -68,9 +68,9 @@ private
Find.prune if @f.skip_clean? path
elsif not path.file?
next
- elsif path.extname == '.la' and not @f.skip_clean? path
+ elsif path.extname == '.la'
# *.la files are stupid
- path.unlink
+ path.unlink unless @f.skip_clean? path
elsif not path.symlink?
clean_file path
end