aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2015-04-17 22:58:02 -0400
committerJack Nagel2015-04-17 22:58:02 -0400
commit505d06c1761dfb89961b4f6b8093c5d62248e5fb (patch)
tree754ec365592b8780f052bace03cdf99332877b4e /Library
parent703de5556fb6c518000832dd618f934ac2067363 (diff)
downloadbrew-505d06c1761dfb89961b4f6b8093c5d62248e5fb.tar.bz2
Simplify cleanup eligibility check
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/cleanup.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb
index 786c08275..3c133cf13 100644
--- a/Library/Homebrew/cmd/cleanup.rb
+++ b/Library/Homebrew/cmd/cleanup.rb
@@ -124,12 +124,9 @@ class Formula
true
elsif opt_prefix.directory?
# SHA records were added to INSTALL_RECEIPTS the same day as opt symlinks
- !Formula.installed.
- select{ |ff| ff.deps.map{ |d| d.to_s }.include? name }.
- map{ |ff| ff.rack.subdirs rescue [] }.
- flatten.
- map{ |keg_path| Tab.for_keg(keg_path).HEAD }.
- include? nil
+ Formula.installed.
+ select { |f| f.deps.any? { |d| d.name == name } }.
+ all? { |f| f.rack.subdirs.all? { |keg| Tab.for_keg(keg).HEAD } }
end
end
end