diff options
Diffstat (limited to 'Library/Homebrew/cmd/cleanup.rb')
| -rw-r--r-- | Library/Homebrew/cmd/cleanup.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index 22ed236f9..f9203c68d 100644 --- a/Library/Homebrew/cmd/cleanup.rb +++ b/Library/Homebrew/cmd/cleanup.rb @@ -110,7 +110,8 @@ module Homebrew return unless HOMEBREW_CACHE_FORMULA.directory? candidates = HOMEBREW_CACHE_FORMULA.children lockfiles = candidates.select { |f| f.file? && f.extname == ".brewing" } - lockfiles.select(&:readable?).each do |file| + lockfiles.each do |file| + next unless file.readable? file.open.flock(File::LOCK_EX | File::LOCK_NB) && file.unlink end end @@ -118,7 +119,7 @@ module Homebrew def rm_DS_Store paths = Queue.new %w[Cellar Frameworks Library bin etc include lib opt sbin share var]. - map { |p| HOMEBREW_PREFIX/p }.select(&:exist?).each { |p| paths << p } + map { |p| HOMEBREW_PREFIX/p }.each { |p| paths << p if p.exist? } workers = (0...Hardware::CPU.cores).map do Thread.new do begin |
