224 Commits

Author SHA1 Message Date
Martin Afanasjew
77dd9d56ff Use GitRepositoryExtension for HOMEBREW_REPOSITORY 2016-07-07 01:46:58 +02:00
Mike McQuaid
59074e91d6 diagnostic: more porting to generic OS. (#449) 2016-07-04 18:35:03 +01:00
Martin Afanasjew
5954877962 diagnostic: use 'Utils.git_version', simplify code
Prefer `Utils.git_version` instead of duplicating version detection
logic. Decouple unnecessary conflated availability and version checks.

Closes #351.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-06-19 22:12:34 +02:00
Mike McQuaid
8a582f2bd9 Make diagnostic code cross-platform. 2016-05-08 16:51:22 +01:00
Andrew Janke
6f80b4688b doctor: guard against nil Xcode.version (#197)
MacOS::Xcode.version may be nil (when neither Xcode nor CLT are installed),
so guard against that where it may happen in `brew doctor`.
2016-05-04 15:54:01 -04:00
Martin Afanasjew
8600b9edf1 Update Homebrew/homebrew references in comments
Replace `homebrew` with `brew`, `homebrew-core`, or `legacy-homebrew`
depending on context.
2016-05-02 21:19:09 +02:00
Andrew Janke
a3b70d38a7 brew-audit: pull style checks in to main audit output
This collects all violations for each formula in a single place, instead
of doing `brew style` outputs for all formulae first, and then the other
audit checks.

Closes #112.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-21 14:45:33 -04:00
Misty De Meo
f5f41f2079 doctor: remove autotools check 2016-04-21 09:36:30 -07:00
Martin Afanasjew
883751d666 diagnostic: fix style of previously skipped method
Fix style of previously omitted `check_for_bad_install_name_tool`
method to be in line with changes made in #49.

Closes #56.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-09 16:12:17 +02:00
Martin Afanasjew
eb137dc924 Revert "diagnostic: improve check for 'install_name_tool'"
This reverts commit 9f79c05656a44f926898774c6029025002bcd621.

Restore check to continue to inspect `/usr/bin/install_name_tool`. See
Homebrew/legacy-homebrew#50091 and Homebrew/legacy-homebrew#50509 for
the full context and more details.
2016-04-09 16:12:17 +02:00
Martin Afanasjew
1d9977b7c1 diagnostic: prefer guard clauses for readability
Guard clauses instead of if/unless blocks make the checks easier to
understand and reduce nesting, thus improving overall readability.

This includes the following additional minor changes:

- Make indentation of commands consistent inside diagnostic messages.
- Fix minor typos and inconsistent punctuation in diagnostic messages.
- Fix here documents to always start with `<<-EOS.undent` on a new line,
  followed by the message (indented once), followed by `EOS` (at the
  same level like `<<-EOS.undent`).
- Always separate the check logic (and guard clauses) from the following
  message by a single empty line (for consistency and readability).
- Standardize on `message` as the variable name when diagnostic messages
  need to be constructed from multiple parts.
- Where easily possible, adapt check logic to stay within 80-column
  limit, use more expressive variable names, and break down long
  expressions into multiple statements with intermediate results.

Closes #49.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-08 17:57:30 +02:00
Xu Cheng
d127569053 diagnostic: point to new remote 2016-04-03 19:05:08 +08:00
Eric Vantillard
9f79c05656 diagnostic: improve check for 'install_name_tool'
`install_name_tool` location depends on the location of the active developer
directory managed by `xcode-select`.

Closes Homebrew/homebrew#50509.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-04-03 12:15:47 +08:00
Dominyk Tiller
ca5b7440c6 diagnostic: make chown recommendation consistent
This is the only place we advise `:admin` as well so might as well
change this one.

Closes Homebrew/homebrew#50279.

Closes Homebrew/homebrew#50295.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-03-22 18:55:19 +08:00
Dominyk Tiller
142be05c0f diagnostic: trim unnecessary 'the' 2016-03-22 18:55:19 +08:00
Josh Hagins
e404a71e43 diagnostic: only warn about local newline config
cd to `HOMEBREW_REPOSITORY` before checking git newline settings.

Closes Homebrew/homebrew#49565.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-03-01 13:25:24 -08:00
Dominyk Tiller
7572e91a60 diagnostic: add new osxfuse exceptions
The recent updates to OSXFuse include two new elements that get flagged by
`brew doctor`. Adding them here so it's consistent with how we handle the rest
of OSXFuse.

Closes Homebrew/homebrew#49372.
2016-02-20 19:24:30 +00:00
Martin Afanasjew
9cab301185 diagnostic: improve check for 'gnubin' in PATH
Both `coreutils` and `findutils` suggest to add `#{opt_libexec}/gnubin`
to PATH in their caveats to get the non-prefixed binaries from those
formulae. Check this in addition to the version-specific directory that
is less likely to be in PATH.

Closes Homebrew/homebrew#48207.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-28 12:53:17 +01:00
Martin Afanasjew
4cc8d3ed8b diagnostic: speed up check for outdated Homebrew
Determine the age of the local `HEAD` first and only if it is older than
24 hours proceed with the much more expensive `git ls-remote` to check
if there are any new upstream commits (there usually will be).

This keeps the overall logic unaltered, but significantly speeds up the
check for users that have recently updated (still slow for all others).

Closes Homebrew/homebrew#48499.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-27 19:07:09 +01:00
Martin Afanasjew
026363e1ed diagnostic: fix autoconf check
Xcode can only provide autotools if it is installed, thus check that
first. Skipping this check will try to compare a `nil` Xcode version to
4.3, the first version of Xcode to not provide autotools.

Fixes Homebrew/homebrew#48208.

Closes Homebrew/homebrew#48278.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-20 10:23:21 +01:00
Josh Bode
b6729191fa diagnostic: update check for findutils.
Check for non-prefixed findutils in path via gnubin symlinks or directly

Closes Homebrew/homebrew#46987.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-18 08:44:47 +00:00
Grant Hutchins
624ca35f42 diagnostic: note El Capitan upgrade permissions.
On all of the machines I have upgraded to OS X El Capitan, my /usr/local
directory has changed ownership. Since this message shows up as an error
during `brew update`, I figured it would be good to beef up the
explanation.

Closes Homebrew/homebrew#44670.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-17 21:57:44 +00:00
Mike McQuaid
a46fa38ea7 diagnostic: warn on outdated OS X versions.
We don't have CI or new bottles for them so they aren't supported well
so we should warn users.

Closes Homebrew/homebrew#47812.
2016-01-09 10:30:44 +00:00
Baptiste Fontaine
9f1442db14 doctor: move code away from cmd/
Closes Homebrew/homebrew#47665.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-05 14:33:06 +01:00