aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cleaner.rb33
1 files changed, 14 insertions, 19 deletions
diff --git a/Library/Homebrew/cleaner.rb b/Library/Homebrew/cleaner.rb
index b79f2978c..b3e320358 100644
--- a/Library/Homebrew/cleaner.rb
+++ b/Library/Homebrew/cleaner.rb
@@ -64,24 +64,7 @@ class Cleaner
end
end
- # Set permissions for executables and non-executables
- def clean_file_permissions path
- perms = if path.mach_o_executable? || path.text_executable?
- 0555
- else
- 0444
- end
- if ARGV.debug?
- old_perms = path.stat.mode & 0777
- if perms != old_perms
- puts "Fixing #{path} permissions from #{old_perms.to_s(8)} to #{perms.to_s(8)}"
- end
- end
- path.chmod perms
- end
-
- # Removes .la files and fixes file permissions for a directory tree, keeping
- # existing files and permissions if instructed to by the formula
+ # Clean a single folder (non-recursively)
def clean_dir d
d.find do |path|
path.extend(ObserverPathnameExtension)
@@ -93,7 +76,19 @@ class Cleaner
elsif path.extname == '.la'
path.unlink
else
- clean_file_permissions(path)
+ # Set permissions for executables and non-executables
+ perms = if path.mach_o_executable? || path.text_executable?
+ 0555
+ else
+ 0444
+ end
+ if ARGV.debug?
+ old_perms = path.stat.mode & 0777
+ if perms != old_perms
+ puts "Fixing #{path} permissions from #{old_perms.to_s(8)} to #{perms.to_s(8)}"
+ end
+ end
+ path.chmod perms
end
end
end