If the repository is set up by `brew update`, the remote URL is
https://github.com/mxcl/homebrew.git, but if it is set up by the install
script, the .git suffix is omitted.
Added checks on doctor.rb for:
* Missing git origin
* git origin not pointing at mxcl/homebrew
Tests use `git config --get remote.origin.url`.
Also added printout of origin to --config.rb.
FixesHomebrew/homebrew#14399.
ClosesHomebrew/homebrew#17117.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
`python --version` doesn't work in some (very) old versions of
python. While I doubt this is going to come up very often, it's
theoretically possible someone has an old python first in their
path. (python -V works on all versions I'm aware of, including
python3, and comes before --version in the --help anyway.)
Also skips the warning in case the regexp matches nothing, which
probably shouldn't happen. But if it does we shouldn't produce the
wrong warning.
Enumerable#one? is not available under Ruby 1.8.6. Further, we really
want #any? here, as setting both HOME and CURL_HOME can trigger a false
negative.
FixesHomebrew/homebrew#15883.
Added doctor check for .curlrc rather than silently ignoring it (#13836).
ClosesHomebrew/homebrew#15419.
Signed-off-by: Max Howell <mxcl@me.com>
Removed test in doctor where it actually curl'd a file. It's enough to warn if the curlrc exists. I understand people want to remove the warnings, but the point in the doctor is to help diagnose and not to be some ramification of your UNIX system.
It looks like there can be harmless stuff leftover in
/Developer/Library, even after Xcode uninstalls older versions. The
existence of the uninstall-developer-folder script should be a better
indicator.
FixesHomebrew/homebrew#14970.
Rescuing false on the StandardCompilers map meant that the doctor
check assumed that the compilers were incorrect, not merely
unknown.
Instead, skip the check and return nil for unknown Xcode; nil
should be interpreted as "dunno", instead of "true" or "false",
and the doctor check no longer prints on nil.
/Developer/Library shouldn't exist if all the remnants of old
Xcode versions have been uninstalled, and tends to cause problems if
it's kept alongside modern Xcode.
"uninstall-developer-folder" should only remove /Developer/Library.
Checking the license text is probably the most future proofed method. Though for future reference other possible methods are listed in the below ticket.
ClosesHomebrew/homebrew#14558.
This is safe, I tested various scenarios, including Homebrew installed in ~. The only files that are removed are unexpected files in Homebrew's already managed directories.
The heuristic for determining whether something is installed changes
from "f.installed?" to "f.rack.exist? and f.rack.subdirs.length > 0" in
order to properly consider outdated formulae.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
-D is now the switch for diagnostic-dumps. Let it be so.
Shows how long each doctor method takes in a sorted table at end. I used this to move the two slowest methods to the end of the doctor run so that as much useful information can be shown as quickly as possible.
Also now possible to specify on command line which tests should be run.
ClosesHomebrew/homebrew#13689.
Signed-off-by: Max Howell <mxcl@me.com>
There are subtle distinctions between writable? and writable_real? we don't
understand precisely why we need this, but it fixes the bugs :/