348 Commits

Author SHA1 Message Date
Mike McQuaid
ffdda0eb9f Tweaks for older Mac OS X versions.
- `brew update` should try to install `curl` before `git` on older
  versions of Mac OS X where it is needed for accessing modern SSL
  certificates.
- We don't need an HTTP mirror for `git` because `curl` will already be
  installed before it is downloaded.
- Don't recommend GCC on Mac OS X versions where it can't be built with
  the default system compiler.
- Start using the Homebrew `curl` on Mac OS X versions where it is
  needed as soon as it is installed.
2017-09-16 12:41:08 +01:00
Mike McQuaid
53038a14b3 Merge pull request #2940 from kevinburke/move-brew-prefix
Speed up brew --prefix
2017-07-25 16:12:25 +01:00
Kevin Burke
be1764c0a5
Speed up brew --prefix
Move --prefix, --cellar to the top of brew.sh. Timings on master:

    brew --prefix > /dev/null  0.05s user 0.03s system 46% cpu 0.165 total
    brew --prefix > /dev/null  0.05s user 0.04s system 63% cpu 0.131 total
    brew --prefix > /dev/null  0.04s user 0.03s system 72% cpu 0.104 total
    brew --prefix > /dev/null  0.04s user 0.03s system 87% cpu 0.080 total
    brew --prefix > /dev/null  0.04s user 0.03s system 81% cpu 0.080 total
    brew --prefix > /dev/null  0.04s user 0.03s system 84% cpu 0.075 total
    brew --prefix > /dev/null  0.04s user 0.03s system 83% cpu 0.080 total
    brew --prefix > /dev/null  0.04s user 0.02s system 84% cpu 0.072 total
    brew --prefix > /dev/null  0.04s user 0.03s system 86% cpu 0.072 total
    brew --prefix > /dev/null  0.04s user 0.03s system 82% cpu 0.075 total
    brew --prefix > /dev/null  0.04s user 0.03s system 85% cpu 0.072 total
    brew --prefix > /dev/null  0.04s user 0.03s system 84% cpu 0.076 total
    brew --prefix > /dev/null  0.04s user 0.03s system 85% cpu 0.074 total
    brew --prefix > /dev/null  0.03s user 0.03s system 83% cpu 0.073 total
    brew --prefix > /dev/null  0.04s user 0.02s system 83% cpu 0.072 total
    brew --prefix > /dev/null  0.03s user 0.03s system 86% cpu 0.068 total
    brew --prefix > /dev/null  0.04s user 0.03s system 82% cpu 0.080 total
    brew --prefix > /dev/null  0.04s user 0.03s system 84% cpu 0.079 total
    brew --prefix > /dev/null  0.04s user 0.02s system 83% cpu 0.070 total
    brew --prefix > /dev/null  0.03s user 0.03s system 84% cpu 0.072 total

With the patch applied:

    brew --prefix > /dev/null  0.02s user 0.02s system 24% cpu 0.157 total
    brew --prefix > /dev/null  0.02s user 0.03s system 53% cpu 0.078 total
    brew --prefix > /dev/null  0.02s user 0.02s system 64% cpu 0.056 total
    brew --prefix > /dev/null  0.02s user 0.03s system 74% cpu 0.065 total
    brew --prefix > /dev/null  0.01s user 0.02s system 73% cpu 0.049 total
    brew --prefix > /dev/null  0.01s user 0.02s system 77% cpu 0.050 total
    brew --prefix > /dev/null  0.01s user 0.02s system 64% cpu 0.054 total
    brew --prefix > /dev/null  0.01s user 0.02s system 77% cpu 0.049 total
    brew --prefix > /dev/null  0.01s user 0.02s system 56% cpu 0.061 total
    brew --prefix > /dev/null  0.02s user 0.02s system 66% cpu 0.060 total
    brew --prefix > /dev/null  0.01s user 0.02s system 62% cpu 0.057 total
    brew --prefix > /dev/null  0.01s user 0.02s system 71% cpu 0.052 total
    brew --prefix > /dev/null  0.02s user 0.03s system 67% cpu 0.063 total
    brew --prefix > /dev/null  0.01s user 0.02s system 70% cpu 0.042 total
    brew --prefix > /dev/null  0.02s user 0.02s system 68% cpu 0.056 total
    brew --prefix > /dev/null  0.01s user 0.02s system 73% cpu 0.049 total
    brew --prefix > /dev/null  0.01s user 0.02s system 62% cpu 0.058 total
    brew --prefix > /dev/null  0.02s user 0.02s system 67% cpu 0.058 total
    brew --prefix > /dev/null  0.01s user 0.02s system 73% cpu 0.043 total
    brew --prefix > /dev/null  0.01s user 0.02s system 65% cpu 0.055 total
2017-07-25 07:00:49 -07:00
Bob W. Hogg
76e246059e Follow the XDG Base Directory specification for caching on Linux
Prefer $XDG_CACHE_HOME if defined, falling back to $HOME/.cache.
The Mac cache location is not affected by this change.

Signed-off-by: Bob W. Hogg <rwhogg@linux.com>
2017-07-24 09:11:14 -07:00
Mike McQuaid
5709002138 brew.sh: always use 7 chars for HOMEBREW_VERSION.
This avoids inconsistency based on Git versions.
2017-07-13 10:06:30 +01:00
Mike McQuaid
5367f1b408 analytics: remove unused analytics.
We didn't end up using the `screenview` and `exception` analytics as
much as expected so let's remove them and focus on stuff that's
formula-specific.
2017-06-07 16:34:54 +01:00
Misty De Meo
7c7a0fc720
brew.sh: don't call xcode-select if it doesn't exist 2017-05-23 18:42:19 -07:00
Mike McQuaid
e1bbab6ca6 Revert "Merge pull request #2603 from MikeMcQuaid/tweak-gem-vendoring"
This reverts commit 2372872974d1049c2beafe7dedb7f8f882502058, reversing
changes made to 3e4547f52e7ebec633f8bfefc8a396d944edf908.
2017-05-07 17:28:37 +01:00
Mike McQuaid
33f83be10e Tweak Gem vendoring.
If people have `HOMEBREW_RUBY_PATH` set then things explode in a rather
confusing fashion. Instead, run `bundle` for them with the arguments
that they'd want.

Also, move `macho` requires into the module itself; it's a pain having
to do everything for Bundler before requiring `pathname` which is a core
Ruby class.
2017-05-07 15:33:54 +01:00
Mike McQuaid
790a113371 brew.sh: >v1.2.0 now. 2017-05-03 12:10:25 +01:00
Mike McQuaid
9731f7a8c4 brew.sh: tweak macOS user agent again.
Safari uses `Mac OS X` not `OS X`. To avoid contaminating other parts of
Homebrew use a separate variable for just this part, too.
2017-04-27 08:53:57 +01:00
Mike McQuaid
f02d7b93a7 brew.sh: use OS X in user agent rather than macOS.
This matches what Safari does on macOS 10.12 and is generally what
tools like Google Analytics expect the format to be.
2017-04-26 16:18:48 +01:00
ilovezfs
a81bd81a14 brew uninstal alias for brew uninstall
If `brew instal` is permissible, `brew uninstal` should be, too.
2017-02-21 04:37:46 -08:00
Mike McQuaid
6040456ea9 Unset GREP_OPTIONS.
Users may have this set, breaking grep's output.

Fixes #1430.
2017-01-16 20:35:56 +00:00
Markus Reiter
a0f9963391 Disallow running brew cask as root. 2016-11-10 15:01:29 +01:00
Mike McQuaid
37518c1b3a brew.sh: bump hardcoded minor version. 2016-11-07 10:31:31 +00:00
Mike McQuaid
eabdbde3f0 brew.sh: disable running Homebrew as root.
November 1st 2016 has come and gone so it's time to disable this.

Also, add comments explaining why the things that have been whitelisted
have been (to avoid more being added without good justification).
2016-11-06 17:37:46 +00:00
Zhiming Wang
0ca697ad2f
brew.sh: communicate when autoupdate runs for long
This will ease user anxiety when `brew install foo' is typed but nothing
seems to happen.
2016-11-02 22:37:08 -04:00
William Woodruff
72b81844ed
Redirect stderr output from git (shim) invocations to /dev/null.
These invocations occur before we can actually automatically install git via
bottle, and as such their output isn't relevant.
2016-10-26 16:33:35 -04:00
Matt Tagg
db6681f2ef brew.sh: tweak xcode hint to auto-accept license
Small improvement to the xcode license hint. Reduces friction by allowing user to accept the license in a single step. 
Reference: http://apple.stackexchange.com/questions/175069/how-to-accept-xcode-license
2016-10-18 18:40:57 -07:00
RasPhilCo
ec03dcfe95 Fix warning for HOMEBREW_REPOSITORY at /usr/local 2016-10-12 10:33:47 -07:00
Mike McQuaid
981cac2a2e brew.sh: warn on $HOMEBREW_REPOSITORY/Cellar
If you’re using a /usr/local prefix but e.g. /usr/local/homebrew/Cellar
then you’ll miss out on most binary packages for no good reason so warn
people of that.
2016-10-11 09:37:37 +01:00
Alex Kirk
7502c85698 Don't display root warning for --prefix 2016-10-10 14:25:07 +02:00
Mike McQuaid
8e231d8ef5 brew.sh: improve user agent with no git repo.
`Homebrew/>1.0.0 (no git repository) (Macintosh; Intel macOS 10.7.5)...)
reads pretty weirdly in a user agent and I've had complaints that `>`
may be an invalid character in some cases.
2016-10-07 18:02:38 +01:00
Mike McQuaid
881fdcd25e Merge pull request #1190 from vladshablinsky/no-autoupdate-on-help
brew.sh: don't autoupdate if --help passed
2016-10-03 18:38:46 +01:00
Uladzislau Shablinski
fd0149783a brew.sh: don't autoupdate if --help passed 2016-10-01 18:18:24 +03:00
Alyssa Ross
e0d39cc3ef analytics: don't report commands run by Homebrew
Fixes #788.
2016-10-01 15:18:09 +01:00
Mike McQuaid
2d804ae436 brew.sh: change directory for HOMEBREW_VERSION.
This stops `-dirty` showing up whenever you aren't in
`HOMEBREW_REPOSITORY`.

Fixes #1108.
2016-09-24 16:05:20 +01:00
Mike McQuaid
5af52410ab brew.sh: fix brew --version outside HOMEBREW_REPOSITORY. 2016-09-22 21:46:11 +01:00
Mike McQuaid
f0e9292acd Use git describe to get the HOMEBREW_VERSION.
For tagged commits produces the output:
- `1.0.1`

For untagged commits with a dirty tree produces the output:
- `1.0.1-19-g23efbc5-dirty`

Performance:
```
git describe --tags --dirty 2> /dev/null
0.07s user 0.01s system 96% cpu 0.086 total
```

This means we can tag any commit without needing to manually remember
to bump the revision every time.
2016-09-22 08:56:40 +01:00
Mike McQuaid
e8ebcb834b update.sh: allow forcing tag update.
To test the tag update functionality allow setting
`HOMEBREW_UPDATE_TO_TAG`.
2016-09-21 09:03:52 +01:00
Mike McQuaid
2ecd73bca4 update-report: migrate on newer auto-update.
If we have a `brew.sh` which has set
`HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION` then let's allow an auto-update
migration. That's because it contains the fix below it _before_ the
update happened which means the auto-update won't fail in the same way
as if updating from an old version.
2016-09-20 09:07:02 +01:00
Mike McQuaid
5d7911fa71 Merge pull request #1028 from penman/install_gems_to_gem_home
Use user GEM_HOME for installing gems
2016-09-20 08:10:23 +01:00
Alyssa Ross
4c773725c7 Use user GEM_HOME for installing gems
Save the value of GEM_HOME before unsetting it,
and resetting it when setting up a gem environment.

Fixes #944.
2016-09-19 19:09:55 +01:00
Mike McQuaid
c30665afa6 brew.sh: fix repository auto-update change.
On auto-update `HOMEBREW_LIBRARY` may change location which means that
it won't be found for the actual install command. Look for this having
occurred and then set the new `HOMEBREW_LIBRARY` (and
`HOMEBREW_REPOSITORY`) accordingly.
2016-09-19 14:12:44 +01: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
dd7ed01807 brew.sh: don't restrict dev-cmd/*.sh to Homebrew developers. 2016-09-08 20:44:32 +01:00
Mike McQuaid
42c2ed5e7f brew.sh: set HOMEBREW_DEVELOPER from Git config. 2016-09-08 20:44:32 +01:00
Mike McQuaid
0cfe51b328 brew.sh: allow cask to be run as root.
It also uses `sudo` for legitimate things e.g. installing `.pkg`s
systemwide.
2016-09-01 20:35:12 +01:00
Dominyk Tiller
0b0893e26e
brew: execute update before tap
This seems generally like a good idea given that we're making syntax changes to
formulae & are going to keep doing so for a little while yet. Taps may have moved
over to that syntax, which then causes tap failures if brew isn't up-to-date.

Should fix situations like https://github.com/Homebrew/homebrew-php/issues/3545.
2016-08-27 15:52:52 +01:00
Mike McQuaid
27b0ca4b47 brew.sh: complain when running Homebrew as root.
As discussed: announce that we are deprecating running Homebrew as the
root user as it's insecure and requires disabling the sandbox.

Fixes #796.
2016-08-25 18:32:32 +01:00
Mike McQuaid
eabc8a2561 brew.sh: don't require /usr/local/Cellar creation.
If you're using e.g. a `/usr/local/homebrew` prefix then don't require
the `/usr/local/Cellar` to be manually created to avoid e.g.
`/usr/local/homebrew/Cellar` being used. Let's do all we can to let
people use this `Cellar` location as it means they can put their
repository wherever they like and still use all our bottles.
2016-08-24 10:04:30 +01:00
Andrew Janke
d57800c45b brew: sanitize BASH_ENV 2016-08-14 17:20:29 -04:00
Mike McQuaid
b6f467b007 Ship Homebrew auto-update support.
Roll this out to everyone (not just developers) and document the
environment variables used for configuration.
2016-08-10 15:46:31 +01:00
Mike McQuaid
1a240cd52a Tweak HOMEBREW_NO_AUTO_UPDATE handling.
This can just live in `brew.sh` and then it doesn’t need repeated in
all the other places.
2016-08-10 15:37:04 +01:00
Martin Afanasjew
79c49b3638 brew.sh: fix style inconsistencies 2016-08-08 16:00:12 +02:00
Xu Cheng
177d988917
brew.sh: make sudo-checker cross-platform 2016-07-17 02:07:06 +08:00
Mike McQuaid
a07ab8bb92 brew.{rb,sh}: move to Library/Homebrew. (#506) 2016-07-15 19:33:30 +01:00