diff options
| author | Adam Vandenberg | 2014-02-23 16:46:44 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2014-05-12 21:22:13 -0700 |
| commit | a78b9063892aeb4e5084edcfc7ed873587997abc (patch) | |
| tree | c7118ad4596c953f489264d087b1540a1eeb0519 | |
| parent | 88865416e92449519ba638e6d5ab47542fcf29f1 (diff) | |
| download | brew-a78b9063892aeb4e5084edcfc7ed873587997abc.tar.bz2 | |
inline this method
| -rw-r--r-- | Library/Homebrew/cleaner.rb | 33 |
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 |
