aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Afanasjew2016-01-02 01:03:54 +0100
committerMartin Afanasjew2016-01-09 18:52:41 +0100
commitbcedfe64e8ca64e092ca72c3f61fe164c28c8af5 (patch)
tree1f64455ea8ce50cd7b79de5234a1095702b2a5d8
parentc9097b40f916d4fa64565bc839f1d33312ebd47a (diff)
downloadbrew-bcedfe64e8ca64e092ca72c3f61fe164c28c8af5.tar.bz2
doctor: simplify handling of slow checks
Some (rather slow) checks should run after all other checks. Make that more obvious by removing them from the sorted list of all checks and then re-appending them to the resulting list. (Should be slightly more efficient than the `<array>.reverse.uniq.reverse` incantation, though that hardly matters given the cumulated run time of all the checks.) Slightly extend the list after verifying what the slowest checks are for various Homebrew installations (slowest check last). Closes Homebrew/homebrew#47753. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
-rw-r--r--Library/Homebrew/cmd/doctor.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 1676f9c76..8f8e1331f 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -12,9 +12,13 @@ module Homebrew
checks.inject_dump_stats! if ARGV.switch? "D"
if ARGV.named.empty?
- methods = checks.all.sort
- methods << "check_for_linked_keg_only_brews" << "check_for_outdated_homebrew"
- methods = methods.reverse.uniq.reverse
+ slow_checks = %w[
+ check_for_broken_symlinks
+ check_missing_deps
+ check_for_outdated_homebrew
+ check_for_linked_keg_only_brews
+ ]
+ methods = (checks.all.sort - slow_checks) + slow_checks
else
methods = ARGV.named
end