62 Commits

Author SHA1 Message Date
Mike McQuaid
2392574a77 brew.rb: only print "Kernel.exit" on failures.
Also, print as a warning to STDERR and print a backtrace in debug mode.

Closes Homebrew/homebrew#47099.

Closes Homebrew/homebrew#47154.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-21 10:05:49 +00:00
Martin Afanasjew
233a38ac95 brew.rb: improve handling of --version/-v option
Make both `--version` and `-v` print the Homebrew version and exit, if
provided as first and sole argument. `brew --version` no longer accepts
additional arguments (they were previously ignored). Otherwise interpret
`brew -v <arguments>` as if `brew <arguments> -v` was executed instead
(no change here), but no longer print a line with the Homebrew version.

Closes Homebrew/homebrew#46790.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2015-12-10 15:01:59 +01:00
Mike McQuaid
6d384a730f brew: cask is now a tap command.
So we can remove the formula installation from `brew.rb`.

Closes Homebrew/homebrew#46843.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-10 09:31:39 +00:00
Mike McQuaid
8d6b6a451b brew.rb: handle cask autoinstall when cask tapped.
Otherwise it would assume if `cask` was tapped it was also installed.
2015-12-08 10:41:27 +00:00
Xu Cheng
ac6b22fd69 auto install certain external commands
Closes Homebrew/homebrew#45773.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-11-09 15:34:20 +08:00
Dominyk Tiller
cfb913b2c2 brew: add more non-root-user sudo checks 2015-10-19 05:54:56 +01:00
Dominyk Tiller
aa0a22147d brew: tighten sudo checks
`reinstall` can currently be executed under sudo and has every chunk of problems
running install under sudo does when `brew` isn't root owned.

Likewise with `postinstall` which we increasingly use to create directories and
move/install files elsewhere. Using sudo there both masks deeper issues and
makes uninstall troublesome.

Closes Homebrew/homebrew#45112.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-10-19 05:33:08 +01:00
Dominyk Tiller
5f86a60e29 brew: check xcode license status
The xcrun code is stolen right out of the INSTALL script.

Check for user agreement of the Xcode license before permitting any other brew usage to continue.
This prevents the situation where people are instructed to "please re-run as root via sudo" on brew commands.
The check can only fail when Xcode is installed & the active developer dir.

Closes Homebrew/homebrew#44974.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-10-15 20:29:41 +01:00
Xu Cheng
ce390b9bd9 add dev-cmd folder 2015-09-12 19:15:45 +08:00
Tim D. Smith
143709e679 include git sha1 in --version output
HOMEBREW_VERSION doesn't change very often; the repository state is more
interesting.

Closes Homebrew/homebrew#41886.
2015-08-25 00:13:53 -07:00
Xu Cheng
d62095710f More core files style updates 2015-08-03 20:38:20 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Baptiste Fontaine
ea13d62ce0 brew: print bug report URL for internal commands only
Closes Homebrew/homebrew#42069.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-07-28 20:38:13 +02:00
Xu Cheng
78a7dea3a0 add brew command
Closes Homebrew/homebrew#41034.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-03 14:22:38 +08:00
Baptiste Fontaine
8ef8f0f615 sudo_check: don't use a set
This is unnecessary here because we use it only once. The difference
won't be noticeable but the check is ~5 times faster now.

Closes Homebrew/homebrew#40901.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-06-20 12:13:26 +02:00
Jack Nagel
72cb403a56 Move 10.11 warning to doctor, pre-install, and post-failure
Fixes Homebrew/homebrew#40778.
2015-06-16 20:02:10 -04:00
Dominyk Tiller
778c25b458 brew: warn about 10.11 unsupported
Issue a warning about Homebrew's very basic support for 10.11 at this point
in time on each run of `brew`.

Closes Homebrew/homebrew#40536.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-06-14 18:38:55 +01:00
Misty De Meo
c72877cc82 Stop supporting Leopard
Is this really Misty?!
2015-05-14 20:58:49 -07:00
Jack Nagel
d4c8f83381 Inline error message 2015-04-21 20:46:02 -04:00
Jack Nagel
136bc02374 Simplify setting load path 2015-04-20 20:31:16 -04:00
Roberto Nibali
39ead112f3 brew.rb: fix help regex.
Don't match `help` at the end of every string because `brew installhelp`
shouldn't really be running help.

Closes Homebrew/homebrew#36559.
Closes Homebrew/homebrew#36576.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-02-06 08:19:35 +00:00
Mike McQuaid
3613f0349e brew.rb: remove unneeded exit code duplication.
Fixes comments made in:
91c267bdb1 (commitcomment-9146910).
2015-01-15 15:58:22 +00:00
Mike McQuaid
bd334c55a0 brew.rb: return exit code from internal commands. 2015-01-04 11:05:34 +00:00
Jack Nagel
318c103802 Remove unnecessary encoding comments
These files do not contain any non-ASCII characters.
2015-01-03 23:44:26 -05:00
Mike McQuaid
26c76381c8 Move SCM wrappers from Contributions to ENV/scm.
Closes Homebrew/homebrew#32615.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-10-02 16:03:23 -07:00
Mike McQuaid
bd8559c791 brew: add contributed tap commands to PATH.
This means that taps root and `cmd` directories are added to the PATH.

This should enable migration of some of our contributed commands into
taps (e.g. `homebrew-boneyard`) and make it easy for third parties to
be able to maintain these. It might also make stuff easier for existing
tools like e.g. `brew-cask` and `boxen`.

Closes Homebrew/homebrew#32471.
2014-09-24 15:14:16 -07:00
Jack Nagel
1e18413848 Fix reference to ISSUES_URL
Fixes Homebrew/homebrew#30848.
2014-07-13 21:24:07 -05:00
Mike McQuaid
7673c40f25 brew.rb: handle single usage flag case. 2014-06-26 09:27:22 +01:00
Mike McQuaid
f61633a076 brew: guard --help with nil cmd. 2014-06-26 09:24:07 +01:00
Mike McQuaid
7ecffd2771 brew.rb: handle -—help for internal/external cmds.
Only display —-help for internal commands and not for external ones;
they can handle the flag themselves.

Closes Homebrew/homebrew#26675.
References Homebrew/homebrew#26755.
Closes Homebrew/homebrew#30300.
2014-06-26 08:37:25 +01:00
Jack Nagel
4a5462cfa8 Switch to "Current" Ruby framework symlink
Closes Homebrew/homebrew#29795.
Closes Homebrew/homebrew#29819.
2014-06-03 11:03:53 -05:00
Adam Vandenberg
2c61e3c02a --help and --version only apply as first argument
This fixes external commands that provide their own
help and version subcommands.

Closes Homebrew/homebrew#26755.
2014-05-27 21:03:05 -07:00
Jack Nagel
42652049b4 Don't attempt to require nil
Fixes Homebrew/homebrew#28942.
2014-05-04 09:15:34 -05:00
Jack Nagel
6577f93f71 Simplify HOMEBREW_LIBRARY_PATH usage 2014-05-02 12:59:38 -05:00
Jack Nagel
2b46af5136 No need to put vendor on the load path 2014-05-02 12:59:38 -05:00
Jack Nagel
f6d81cf762 require accepts Pathnames 2014-05-02 12:59:38 -05:00
Jack Nagel
1ff182ae68 Set ENV variables to strings, not pathnames 2014-05-02 12:59:38 -05:00
Jack Nagel
2d156f06c8 Use File::PATH_SEPARATOR 2014-05-02 12:59:37 -05:00
Jack Nagel
aa5a5a526f Rename Xcode.folder to MacOS.active_developer_dir
This reflects what Apple calls it in more recent versions of Xcode/OS X.
2014-05-01 18:36:46 -05:00
Adam Vandenberg
d4b0599a86 --config -> config 2014-04-30 19:09:29 -07:00
Jack Nagel
20c150fb8c Xcode.bad_xcode_select_path? is used only once, so inline it 2014-04-15 11:28:52 -05:00
Mike McQuaid
3a5c14cea4 brew: allow external cmds to use Homebrew.failed. 2014-04-11 16:02:41 +01:00
Jack Nagel
66c8f2707c Reorganize conditional to avoid shelling out if possible 2014-04-01 18:40:20 -05:00
Mike McQuaid
eabe9dc6d0 brew: check for --help and friends in more of ARGV
Let's check for e.g. --help anywhere in the ARGV array rather than just
the first value to avoid brew upgrade --help causing problems.

Closes Homebrew/homebrew#26675.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-02-14 18:32:56 +00:00
Misty De Meo
5994fd469c xcode-select check: move after first options 2013-12-13 19:17:56 -08:00
Misty De Meo
ea646cd428 Adjust bad xcode-select path exit code 2013-12-13 09:29:35 -08:00
Misty De Meo
775406be91 brew: error out if bad xcode-select path given
Since a bad xcode-select path can cause many brew commands to freeze,
it's worth warning users and bailing out as early as possible.

The doctor check wasn't good enough, since the doctor could freeze
before the warning about this was ever printed.
2013-12-13 08:52:29 -08:00
Jack Nagel
4a5b65c9f5 Remove "-c1" one-line config
This is broken and nobody noticed, so remove it.

Closes Homebrew/homebrew#23878.
2013-11-01 19:04:04 -05:00
Mike McQuaid
d9d2443d5d Cleanup use of some global constants. 2013-10-30 13:20:48 -07:00
Jack Nagel
df824a22a7 Avoid comparing MacOS.version to floats 2013-10-22 20:47:37 -05:00