diff options
| author | Max Howell | 2012-03-15 16:37:46 +0000 |
|---|---|---|
| committer | Max Howell | 2012-03-16 00:20:49 +0000 |
| commit | 9bba1590c5dae92cb91a95a32d06c3b26437798d (patch) | |
| tree | debd33d8bc48d6ba21e55abf5cc9d0f8a64458cc /Library | |
| parent | 3b771d09e48f4dfa88ef4c5d32f3b84ca2ae18ec (diff) | |
| download | homebrew-9bba1590c5dae92cb91a95a32d06c3b26437798d.tar.bz2 | |
Warn about broken symlinks in HOMEBREW_PREFIX
Refs #10874.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 04696da32..4a981f7ca 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -166,6 +166,21 @@ def check_for_other_package_managers end end +def check_for_broken_symlinks + broken_symlinks = [] + %w[lib include sbin bin etc share].each do |d| + d = HOMEBREW_PREFIX/d + d.find do |pn| + broken_symlinks << pn if pn.symlink? and pn.readlink.expand_path.to_s =~ /^#{HOMEBREW_PREFIX}/ and not pn.exist? + end + end + unless broken_symlinks.empty? then <<-EOS.undent + Broken symlinks were found. Remove them with `brew prune': + #{broken_symlinks * "\n "} + EOS + end +end + def check_gcc_42 if MacOS.gcc_42_build_version == nil # Don't show this warning on Xcode 4.2+ |
