Skip to content
Browse files

Doctor check for unlinked not-keg-only brews

Since these cause trouble.
  • Loading branch information...
1 parent 64b373a commit f01da11622a185c495c348ef5c24d38173912f7e @mxcl mxcl committed with Mar 9, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 Library/Homebrew/doctor.rb
View
19 Library/Homebrew/doctor.rb
@@ -824,6 +824,25 @@ def outdated_homebrew
end
end
+ def 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
+
def ppc
case Hardware.cpu_type
when :ppc, :dunno

0 comments on commit f01da11

Please sign in to comment.
Something went wrong with that request. Please try again.