aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMax Howell2012-03-09 11:36:34 +0000
committerMax Howell2012-03-16 21:06:17 +0000
commit0364fef0a36a52b40f53a31a654b9e887460af7a (patch)
tree0455ed7dbb9a916b02690232ccd49f6eef5fff57 /Library/Homebrew/cmd
parentb584043e63ad4fab1064bbcc23dc37b16aee8b0b (diff)
downloadhomebrew-0364fef0a36a52b40f53a31a654b9e887460af7a.tar.bz2
Doctor check for unlinked not-keg-only brews
Since these cause trouble.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/doctor.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index d71592032..9d4d0abe1 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -842,6 +842,25 @@ def check_for_outdated_homebrew
end
end
+def check_for_unlinked_but_not_keg_only
+ unlinked = HOMEBREW_CELLAR.children.reject do |rack|
+ if not (HOMEBREW_REPOSITORY/"Library/LinkedKegs"/rack.basename).directory?
+ Formula.factory(rack.basename).keg_only? rescue nil
+ else
+ true
+ end
+ end.map{ |pn| pn.basename }
+
+ if not unlinked.empty? then <<-EOS.undent
+ You have unlinked kegs in your Cellar
+ Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
+ those kegs to fail to run properly once built.
+
+ #{unlinked * "\n "}
+ EOS
+ end
+end
+
end # end class Checks
module Homebrew extend self