289 Commits

Author SHA1 Message Date
Mike McQuaid
d1ba4f44c0 Merge pull request #833 from DomT4/death_by_xcode
xcode: die unless Xcode/CLT up-to-date on prerelease macOS
2016-09-07 09:51:06 +01:00
Mike McQuaid
f1cc1265af Refactor MacOS check_development_tools usage.
Better use the abstraction layer so e.g. Linux could have similarly
fatal checks for these things.
2016-09-07 09:11:06 +01:00
Mike McQuaid
dfcbefff73 Merge pull request #201 from gregory-nisbet/feature-env-shells
--env: support more shells, allow explicit shell selection
2016-09-04 21:23:33 +01:00
Mike McQuaid
2691cf1b8b diagnostic: tweak /usr/local messaging.
Highlight that the main reason for preferring /usr/local is because of
bottles. There's been some confusion around this e.g.
https://github.com/Homebrew/homebrew-core/issues/3968
2016-08-25 15:29:43 +01:00
Mike McQuaid
74cdfe491f Revert "diagnostic: ignore duplicated brew-cask commands" 2016-08-22 10:28:03 +01:00
Mike McQuaid
ff8d22f3b3 diagnostic: ignore duplicated brew-cask commands
These are intentionally duplicated for now until the Cask migration is
complete.
2016-08-19 14:14:18 +01:00
Mike McQuaid
739881b482 diagnostic: don't barf if HEAD is also a file.
Closes #694.
2016-08-16 14:31:50 +01:00
Greg Nisbet
bf63c08d50 tests for shell-specific diagnostic message 2016-08-10 23:21:30 -07:00
Greg Nisbet
f0cc815d86 Multi-shell diagnostic check 2016-08-10 23:21:30 -07:00
Greg Nisbet
9a29a306cf resolve conflict in diagnostic.rb 2016-08-10 23:19:09 -07:00
Dominyk Tiller
fdcdcf7350 diagnostic: remove MacGPG2 check
This hasn't been an issue for upstream stable releases for 3 years, since March
2013, and hasn't been an issue for pre-release versions for 4 years.

That release, and indeed the latest modern GPGTools releases, support 10.6 and
above so there's no reason to suspect people are actually encountering the old
versions in the wild with enough regularity to merit this being a permanent part
of our codebase any more.

In the last two years Homebrew has seen one Issue where MacGPG2 was the problem,
and that wasn't reproducible at the time (and still isn't), and the `doctor` check
likely wasn't even raised there. There has only been one Issue where the MacGPG2
`doctor` check was raised in that two year period.

I think it's fair to treat this as an user configuration outlier now rather than
an issue we need to be constantly on guard for.

Ref: Homebrew/legacy-homebrew@dfb171b
Ref: Homebrew/legacy-homebrew#12238
Ref: Homebrew/legacy-homebrew@046498b
2016-08-10 08:16:09 +01:00
Mike McQuaid
164e46a729 Add missing development_tools requires. 2016-07-29 21:21:02 -06:00
Mike McQuaid
9f74ca80af diagnostic: port to generic layer. 2016-07-27 15:05:42 -06:00
Vlad Shablinsky
3fb5d70a72
Unify Version.create usage
Substitue each Version.new and HeadVersion.new with Version.create
to unify Version and HeadVersion instantiation among core code.

Note that this does not relate to Mac::OS::Version class.
2016-07-16 20:39:13 +08:00
Dominyk Tiller
288aff5365
diagnostic: adopt more certain tone
Closes #481.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-07-10 12:41:08 +01:00
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