289 Commits

Author SHA1 Message Date
Mike McQuaid
8205e61e64 More environment filtering tweaks
- only document HOMEBREW_* variables in the manpage (although still
  read from all the original environment variables).
- resort manpage environment variables in alphabetical order
- check the original path for trailing slashes
2017-05-13 11:42:01 +01:00
Markus Reiter
5828eefd01 Remove to_s from some Pathnames. 2017-05-08 13:37:28 +02:00
Markus Reiter
24f48ae7d9 Use PATH#select. 2017-04-30 21:11:28 +02:00
Markus Reiter
22f624b373 Make PATH enumerable. 2017-04-30 21:11:28 +02:00
Markus Reiter
f8ad9d7efd Use PATH where possible. 2017-04-30 21:11:27 +02:00
Mike McQuaid
11acadaa50 Merge pull request #2524 from MikeMcQuaid/more-env-filtering-fixes
Hide sensitive tokens from install/test/post.
2017-04-23 09:45:47 +01:00
Mike McQuaid
d02b4f321d Hide sensitive tokens from install/test/post.
Hide these tokens to avoid malicious subprocesses e.g. sending them
over the network. Also, support using these tokens with environment
filtering and clear `HOMEBREW_PATH` from subprocesses to stop them
sniffing it. Finally, use `HOMEBREW_PATH` to detect Homebrew’s user’s
PATH for e.g. `brew doctor` etc.
2017-04-22 16:31:19 +01:00
Mike McQuaid
ba3c46d24f More deprecations.
Deprecate more methods. Internal APIs have been verified to be unused
elsewhere and removed. External APIs have had deprecation methods added.
Existing deprecations have been either upgraded to produce warnings or
no longer deprecated and the reasoning documented.
2017-04-22 16:28:07 +01:00
Mike McQuaid
b757c927af diagnostic: also accept trailing / on git urls. 2017-03-28 19:44:30 +01:00
Mike McQuaid
46a91428f7 Merge pull request #2413 from JCount/increase-minimum-git-version
diagnostic: increase minimum git version to 1.8.5
2017-03-28 19:35:15 +01:00
JCount
08523d393f diagnostic: increase minimum git version to 1.8.5
older versions do not support the 'git -C <path>' option
2017-03-28 12:05:06 -04:00
Mike McQuaid
677db79c29 diagnostic: check homebrew/core git remote.
Check the remote for homebrew/core as well as homebrew/brew as we've
seen a few cases (e.g. #2387) where it was misconfigured.

While we're here, tweak the messaging to tell people what to do and how
to do so with a single command.
2017-03-26 20:28:11 +01:00
Viktor Szakats
cc8f029f22 secure urls + remove -k from in-doc curl command 2017-03-14 17:27:11 +00:00
Mike McQuaid
aaf70eb696 Merge pull request #1676 from MikeMcQuaid/doctor-tap-repo-bad-ruby-files
diagnostic: check for bad tap files.
2016-12-25 21:21:58 +00:00
Mike McQuaid
8f80cc6568 diagnostic: check for bad tap files.
Check for Ruby files in taps that are outside of the detected `Formula`
directory for a tap but inside one of the other potential directories.

This usually indicates a formula has been added in the wrong directory
in a tap and is used to fail CI in this case.
2016-12-13 01:53:05 +00:00
Mike McQuaid
950512ad34 diagnostic: check for multiple Cellars.
And tell people to delete the HOMEBREW_REPOSITORY one. The
HOMEBREW_PREFIX one is preferable for bottling.
2016-12-13 00:19:46 +00:00
Mike McQuaid
e330047ff9 diagnostic: silence a Jenkins doctor warning.
Allow our Jenkins CI testing for Homebrew/brew to live outside of
`/usr/local` without complaint (as it's not using any binary packages
anyway).
2016-11-26 16:32:48 +00:00
Mike McQuaid
771ae5c528 Revert "Merge pull request #1562 from woodruffw/check-admin-group"
This reverts commit 7f13b37b903564e2a64cea982d6b84d1aa6b800b, reversing
changes made to 62e0ecdaafbc6779205908c7ab191c884473afd6.
2016-11-25 16:44:33 +00:00
Mike McQuaid
64cb52ef3e Revert "Merge pull request #1567 from cesarandreu/fix-diagnostic-conditonal"
This reverts commit 89c3348923c3450d8d32f1252abd53209b39c288, reversing
changes made to 7f13b37b903564e2a64cea982d6b84d1aa6b800b.
2016-11-25 16:44:30 +00:00
Cesar Andreu
3b53418a2b Fix early exit condition for check_for_member_of_admin_group 2016-11-25 02:30:50 -08:00
William Woodruff
bb0e683bc4
diagnostic: check if the user is a member of the admin group.
Non-administrative users are unable to run `brew linkapps` (and possibly other
commands) under normal circumstances.
2016-11-24 12:26:50 -05:00
Markus Reiter
c648518f35 Rename single line block parameters to acc/elem. 2016-11-13 23:36:04 +01:00
Mike McQuaid
9edf8eb1fe Check the lock directory is writable.
And, if it isn't, print more helpful debugging messages.

Fixes #1456.
2016-11-11 22:52:21 +00:00
Mike McQuaid
2ce17a1137 Merge pull request #1082 from alyssais/uninstall_dependancy_error
uninstall: refuse when dependents still installed
2016-11-11 08:23:57 +00:00
Mike McQuaid
b8647778ee Merge remote-tracking branch 'origin/master' into HEAD 2016-11-06 17:58:24 +00:00
Mike McQuaid
262eaca56e diagnostic: add build error checks. 2016-11-05 10:58:39 -04:00
Mike McQuaid
b38f5b3e7d diagnostic: only make minimum Xcode/CLT version checks fatal.
Also: freeze the relevant arrays.
2016-11-05 10:58:39 -04:00
Josh Hagins
b35134239a diagnostics: whitelist dylib installed by SentinelOne 2016-11-04 12:18:23 -04:00
James Young
f46e0032bf Add static libs and dylibs commonly put in /usr/local/lib by Symantec Endpoint Protection to the brew doctor white lists 2016-11-04 14:35:54 +00:00
Alyssa Ross
0cd983487c missing_deps: extract formula instance method 2016-10-25 22:34:35 +01:00
Alyssa Ross
c88b67f3a8 missing: simplify code a bit 2016-10-25 22:34:35 +01:00
ilovezfs
7fa4ffe3dc missing: allow hiding specified formulae 2016-10-25 22:34:35 +01:00
Paolo G. Giarrusso
aa8242bb66 brew doctor: warn about SSL_CERT_FILE (#1284)
Multiple issues have been filed about this environment variable, hence
give a warning. #932 might make this unnecessary when merged, but
hopefully this warning can be merged quickly.
2016-10-13 17:58:29 +02:00
Mike McQuaid
21ff82be7f diagnostic: handle HOMEBREW_TEMP mktmpdir failure.
Fixes #1223.
2016-10-09 14:33:04 +01:00
Markus Reiter
ddf5583208 Refactor Cask’s extensions. 2016-10-04 15:43:58 +02:00
Mike McQuaid
8a57fee68c */diagnostic: tweak messaging.
Update some messaging based on recent user confusion and the
`/usr/local/Homebrew` and Ruby 2 migrations.
2016-10-02 17:30:08 +01:00
Markus Reiter
884b268506 Use Formatter for all URLs. 2016-10-01 20:00:49 +02:00
Mike McQuaid
2405c3e205 doctor: remove outdated Homebrew check.
This is no longer relevant in the bright, new tagged future.

Fixes #1151.
2016-09-26 12:13:18 +01:00
Markus Reiter
b5f8de8bf4 Fix Style/RegexpLiteral. 2016-09-23 15:30:07 +02:00
Markus Reiter
0406f918a6 Fix Style/SingleLineBlockParams. 2016-09-23 15:30:07 +02:00
Markus Reiter
4064084c58 Fix Style/MethodName. 2016-09-23 15:30:06 +02:00
Markus Reiter
0581dda187 Auto-correct guard clauses. 2016-09-23 15:30:05 +02:00
Mike McQuaid
3f9cce0a03 Use new "macOS" naming where appropriate.
Not quite a mass replacement as I've used OS X and Mac OS X where
describing specific older versions and added compatibility methods
for things in the DSL.
2016-09-18 19:57:19 +01:00
Mike McQuaid
1bdbb0f462 Improve rescue nesting. 2016-09-17 17:01:04 +01:00
Mike McQuaid
6693915399 rubocop --auto-correct all remaining files.
But remove some manual `.freeze`s on constants that shouldn't be
constants.
2016-09-17 16:14:13 +01:00
Mike McQuaid
1c5fa19f84 Merge pull request #966 from MikeMcQuaid/keg-lock-constants
Use constants for LinkedKegs/PinnedKegs/Locks.
2016-09-15 18:57:04 +01:00
Mike McQuaid
72d10fff0b Use constants for LinkedKegs/PinnedKegs/Locks.
These definitions are scattered throughout the codebase which makes it
hard to refactor them later (my goal is to move them outside of
HOMEBREW_LIBRARY). Unify their definitions for clearer code and easier
movement later.
2016-09-15 18:28:42 +01:00
Mike McQuaid
842d6ce8bd keg: add ALL_TOP_LEVEL_DIRECTORIES constant.
This is used in diagnostic (and will be used in other places later)
rather than hard-coding other directories later.
2016-09-15 09:20:39 +01:00
Mike McQuaid
30fd4f3fe5 diagnostic: remove duplicate checks. 2016-09-09 13:08:02 +01:00
Mike McQuaid
492391f5fe Don't require/recommend ownership of /usr/local.
Apple reset this on every OS X major (and some minor) updates and it
always proves a painful and unnecessary step. Instead just check the
directories we actually care about are writable.

This may mean if these directories do not already exist (although they
are now created by the installed) that `brew link` will fail and require
manual intervention but this seems to be superior for both new and the
majority of existing users.
2016-09-09 08:06:37 +01:00