456 Commits

Author SHA1 Message Date
Patrick Lucas
47cdd4d819 Suggest git clean -f for untracked changes
Currently, if brew doctor detects untracked changes in the local repo,
it suggests doing 'git reset --hard', but that doesn't remove untracked
files. This change adds an additional suggestion to run 'git clean -f'
to remove them.

Closes Homebrew/homebrew#12814.

Signed-off-by: Max Howell <mxcl@me.com>

Changed the path to Library as we don't want to clean -f all over the whole /usr/local :P
2012-08-06 15:59:12 -04:00
Max Howell
28c9b8f601 Put the CLT advice warning in the right place
Refs Homebrew/homebrew#13982.
2012-08-06 13:26:39 -04:00
Max Howell
a9f246eaad Point out to that you may want to install the CLT
You have to hold people's hands, they won't google anything.

Refs Homebrew/homebrew#13982.
2012-08-06 13:06:36 -04:00
Jack Nagel
bbcbbcdaa1 Remove X11 doctor check
Now that X11 components are specified as dependencies, users will be
prompted to install these components when necessary, and this check is
no longer needed.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-06 00:42:43 -05:00
Max Howell
3ea35f3351 Some users require hands to be held constantly
Tell user exactly what command to use rather than thinking they'll figure it out by applying some negation logic to the main verb in the sentence they just read.

Closes Homebrew/homebrew#12790.
2012-08-05 10:46:35 -04:00
Jack Nagel
148617bc11 Move X11 machinery into MacOS::XQuartz namespace
In order to better support Xcode-only systems, where X11 libs and
executables live under /usr/X11 but headers live in the SDK, move the
x11_* helper methods into a new module.

This allows us to keep some of the CLT/Xcode-only and Apple X11/XQuartz
logic hidden from outside code, like ENV.x11.

Since Apple's X11 is actually XQuartz, name the module "MacOS::XQuartz".
2012-08-01 00:31:38 -05:00
Mike McQuaid
450dcf75dc Fix brew doctor warnings and spurious newline.
Fixes the problems discussed in 34c970 to ensure that `brew doctor`
does not look like it is broken on user setup problems but still
returns a sensible exit code for e.g. BrewBot.
2012-07-25 22:54:44 +01:00
Jack Nagel
74839417ea Rename xctools_fucked?
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-25 12:04:42 -05:00
Jack Nagel
4eeb0e6441 Use new Xcode module
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-25 12:04:41 -05:00
Jack Nagel
62482504a9 Split Xcode and CLT methods into separate modules
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-25 11:58:01 -05:00
Adam Vandenberg
fd7cf8f293 doctor: be consistent in path advice 2012-07-24 12:28:02 -07:00
Adam Vandenberg
5de94e48bd doctor: check for DYLD_FALLBACK_LIBRARY_PATH 2012-07-23 16:08:05 -07:00
Misty De Meo
a8a16928e4 doctor: Skip outdated check when offline
Fixes Homebrew/homebrew#13535.
2012-07-22 12:57:03 -05:00
Misty De Meo
3696180fd7 Update Xcode checks for 10.8 2012-07-12 14:34:00 -05:00
Jack Nagel
bb2e67f37e doctor: fix incorrect usage of 'or'
Eventually I will stop making this mistake.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-12 03:01:28 -05:00
Adam Vandenberg
126b1c77e3 doctor: update xcode chceck
* 4.3.3 is the latest on 10.7
* Give up if we don't know what the latest is (10.8 and beyond)
2012-07-07 11:59:01 -07:00
Jack Nagel
e65c3a71eb Update doctor checks for XQuartz
- pkg-config no longer defaults to checking /usr/X11/lib/pkgconfig;
   instead this path is added via ENV.x11 or depends_on :x11. Formulae
   that expect X11 libs should be explicitly marked as depends_on :x11.
 - Remove warning about /usr/X11 as a symlink.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-01 12:23:19 -05:00
samueljohn
4aed55cccb doctor: suggest the correct xcode-select path to the user
Shortened the part about the CLT-only systems, because this message is
never shown to them.

Closes Homebrew/homebrew#13061.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-29 12:40:26 -05:00
samueljohn
13e14ef65a Fix Homebrew/homebrew#13012 properly and don't set the SDK if CLT
Undoing parts of the hot fix 78b9e8548e771a59e382e6f13339664ec5498391.

The only thing missing was to check for `system "/usr/bin/xcrun -find make 1>/dev/null 2>&1"`
and then it's safe to call locate.

This commit restores the original functionality but without the risk for recursion
and improves the logic of `MacOS.locate`. See below.

To important changes in this commit:

- For Xcode _and_ CLT: don't add the SDK and leave things as before.
So if `MacOS.clt_installed?`, then no `SDKROOT` and `-L` and `-I`
directories are set in `ENV.macosxsdk`.

- Improved the logic for `MacOS.locate` for Xcode-only situations
by assuring that the xcode-select path is correct. This is done
by checking that `bin/make` exists and is executable. Otherwise it
was possible to set xcode-select to an empty dir.
This check is done in `MacOS.sdk_path` too.
We are now able to use Xcode wherever it is and can work even, if
xcode-select is set to invalid values. (Remember some users don't
have sudo access and that is needed to fix xcode-select).

Some minor whitespace fixes.
Minor backtick fix in doctor.rb's printout.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-06-27 11:50:43 -07:00
samueljohn
212dc98003 doctor: check for ~/.pydistutils.cfg
Closes Homebrew/homebrew#12363.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-26 19:41:22 -05:00
samueljohn
725feb3db1 Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!

Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)

Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.

Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.

Closes Homebrew/homebrew#10510.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-06-24 19:11:06 -07:00
Tim Oram
3147dd134a doctor: rewrite Volume class to fix issue with google update engine
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-06-23 10:18:16 -07:00
Misty De Meo
0d2e26fc58 doctor: skip missing_deps when no Cellar exists
Another fix for Homebrew/homebrew#5188.
2012-06-19 10:08:19 -05:00
Misty De Meo
d1baf42d94 doctor: skip outdated_homebrew check when no git 2012-06-19 10:03:11 -05:00
Misty De Meo
faf332054f doctor: don't warn about recent MacGPG2 versions
Fixes Homebrew/homebrew#12238.
2012-06-19 09:25:18 -05:00
Misty De Meo
c2b057fc70 doctor: skip Cellar test if Cellar doesn't exist
Fixes Homebrew/homebrew#5188 (again).
2012-06-19 09:24:59 -05:00
Misty De Meo
6229a20db7 doctor: Mono-specific warning for pkg-config
Mono installs its own pkg-config symlink into /usr/bin/pkg-config,
which breaks non-Mono builds. Provide a specific warning.

Closes Homebrew/homebrew#12859.
2012-06-17 12:17:11 -05:00
Adam Vandenberg
ec4b34aa08 Fix doctor's use of missing.
`brew doctor` shelled to `brew missing` and parsed the results.
When VERBOSE was true, this caused an error as extra, unexpected
output is generated.

Make missing an internal command, and give it a programmatic interface.
2012-06-12 20:03:26 -07:00
Jack Nagel
9e2fc82ad6 Use which method in doctor
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-12 00:17:36 -05:00
Jack Nagel
65bea86ae9 doctor: improve outdated Homebrew check
We now skip the outdated check if our local origin/master tracking
branch matches the origin remote's current master. This prevents false
positives when we are actually up-to-date but the latest commit is over
24 hours old.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-03 10:32:40 -05:00
Jack Nagel
ec3615fec7 doctor: rework check_pkg_config_paths
pkg-config can give us this information a colon-separated list; use
that.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-13 19:28:03 -05:00
Jack Nagel
210c9ac205 Use 'which' helper method more
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-13 19:28:03 -05:00
Misty De Meo
71d34a86d6 doctor: report if a path element is invalid
Under certain circumstances, an invalid path element would cause
File.expand_path to bail out. Catch mistakes and report them, then
continue instead.

Fixes Homebrew/homebrew#12154
2012-05-11 09:48:51 -05:00
Jack Nagel
68124d481f Unify 'which' and which_s' utility methods
'which' only returns a Pathname or nil, and doesn't care about anything
sent to stderr, so just silence it by default and combine the two
methods.

Closes Homebrew/homebrew#12115.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-07 21:05:47 -05:00
Mike McQuaid
fe969c21ad Add ofail command and fix bottle command output. 2012-04-30 21:38:08 +08:00
Adam Vandenberg
1d975de41b doctor: add another path to the macgpg2 check 2012-04-28 14:08:05 -07:00
Jack Nagel
472322af24 Don't attempt to walk nonexistent directories
Fixes Homebrew/homebrew#11298.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-17 17:10:47 -05:00
Misty De Meo
4dc1a7bdce brew doctor: add check for outdated compilers
A common source of build problems on Xcode 4.3+ is outdated compilers,
usually when a user has installed over top of an old version and hasn't
installed the CLT. Since the compilers from the previous Xcode are still
around, brew doctor wouldn't complain.

This adds a hash containing a list of the canonical compiler versions
for supported versions of Xcode, and adds a check against that to determine
whether a given installation has any compilers which are out of date.

Closes Homebrew/homebrew#11518.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-04-11 10:08:46 -05:00
Misty De Meo
c134ba6c4a doctor: be specific about libiconv files detected
Closes Homebrew/homebrew#11417.
2012-04-09 13:19:42 -05:00
Misty De Meo
c9fd1b9bf0 doctor: skip Cellar checks if Cellar doesn't exist
Attempting to call certain methods on the Cellar before it exists,
such as realpath, would cause brew doctor to throw unnecessary "file
does not exist" errors. This was fixed once before, but new tests
have been added since without the appropriate checks.
cf. 0d28bc78d71590c8e8a5961d8d10e3d7d9b8822d

Fixes Homebrew/homebrew#5188 (again).
2012-04-08 15:50:16 -05:00
Rory O’Kane
c2ca1773c5 doctor: fix typos
Closes Homebrew/homebrew#11418.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-03 16:21:01 -05:00
Mike McQuaid
0cbdeeaa3c Exit with bad exit code on command failures. 2012-03-29 18:44:37 +11:00
Adam Vandenberg
23664db4d7 brew doctor: check for trailing slashes in path
Having path directories with trailing slashes can cause other false
warnings.

Closes Homebrew/homebrew#9986.
2012-03-21 22:03:21 -07:00
Jack Nagel
76c86d1ac8 Update missing Xcode advice
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-21 12:47:51 -05:00
Jack Nagel
fa837edcbb Update Xcode version checks
Closes Homebrew/homebrew#11044.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-20 19:06:59 -05:00
Mike McQuaid
23b84ef732 Set MACOS_VERSION as 0 on non-OSX platforms. 2012-03-18 15:43:39 +13:00
Max Howell
d01e9a8fd7 Don't warn about .DS_Store
Fixes Homebrew/homebrew#11018.
2012-03-18 00:16:09 +00:00
Adam Vandenberg
1cdd35b7e8 doctor: check OS version
We warn if you are not running the latest Leopard or Snow Leopard.
(We do not currently check Lion or Mountain Lion versions.)
2012-03-17 11:56:32 -07:00
Max Howell
15f3e9ea77 Doctor check for unlinked not-keg-only brews
Since these cause trouble.
2012-03-16 21:06:17 +00:00
Max Howell
a42714ce82 Improve CLI tools suggestion doctor text 2012-03-16 01:03:24 +00:00