aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorNaoto Kaneko2017-02-24 17:44:27 +0900
committerNaoto Kaneko2017-02-24 17:44:27 +0900
commitccc9b2dc6dc27026673db3c8871c691be9541342 (patch)
tree975367d34b07c6347d33109cdae34a59f206a2f2 /Library
parent56a0afe5792d398d1682426bbebb1e53346b34d5 (diff)
downloadbrew-ccc9b2dc6dc27026673db3c8871c691be9541342.tar.bz2
Check for metafiles only in the root directory
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