aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg.rb5
-rw-r--r--Library/Homebrew/test/keg_test.rb4
2 files changed, 6 insertions, 3 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index 9849a291e..9ebfc3bc3 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -207,9 +207,8 @@ class Keg
alias eql? ==
def empty_installation?
- Pathname.glob("#{path}/**/*") do |file|
- return false if file.executable?
- next if file.directory?
+ Pathname.glob("#{path}/*") do |file|
+ return false if file.directory? && !file.children.reject(&:ds_store?).empty?
basename = file.basename.to_s
next if Metafiles.copy?(basename)
next if %w[.DS_Store INSTALL_RECEIPT.json].include?(basename)
diff --git a/Library/Homebrew/test/keg_test.rb b/Library/Homebrew/test/keg_test.rb
index bd4232038..e8f99b777 100644
--- a/Library/Homebrew/test/keg_test.rb
+++ b/Library/Homebrew/test/keg_test.rb
@@ -59,6 +59,10 @@ class LinkTests < LinkTestCase
(@keg/"bin").rmtree
assert_predicate @keg, :empty_installation?
+
+ (@keg/"bin").mkpath
+ touch @keg.join("bin", "todo")
+ refute_predicate @keg, :empty_installation?
end
def test_linking_keg