180 Commits

Author SHA1 Message Date
William Woodruff
949c0cc47e
brew.sh: Use realpath to calculate tmpdir 2018-06-30 09:47:15 -04:00
William Woodruff
35138dd6dd
brew.sh: Don't allow system tmp dirs as prefixes 2018-06-30 09:38:15 -04:00
Mike McQuaid
376f67bf2c
Merge pull request #4390 from MikeMcQuaid/linkage-cache-default
linkage: enable cache by default.
2018-06-29 20:35:13 +01:00
Mike McQuaid
d3968fc327
Merge pull request #4391 from MikeMcQuaid/remove-unused-var
brew.sh: remove unused variable.
2018-06-29 20:34:57 +01:00
Mike McQuaid
ec6420229e brew.sh: remove unused variable.
As of #4377 this is no longer used.
2018-06-29 20:12:22 +01:00
Mike McQuaid
1bf3aacc79
Merge pull request #4389 from MikeMcQuaid/bintray-portable-ruby
portable-ruby: respect HOMEBREW_BOTTLE_DOMAIN variable.
2018-06-29 20:07:11 +01:00
Mike McQuaid
6f5c8b8509 linkage: enable cache by default.
This has not been causing any issues in CI or for `master` users so
let's now enable it by default for everyone.
2018-06-29 19:57:39 +01:00
Mike McQuaid
facd76bc51 portable-ruby: respect HOMEBREW_BOTTLE_DOMAIN variable.
This was requested in:
https://discourse.brew.sh/t/adding-additional-download-sources-to-homebrew/2446

With this change you can use e.g. Artifactory for Homebrew's portable
ruby.
2018-06-29 19:51:18 +01:00
Jack Haden-Enneking
9fd5a92ff6 Implement HOMEBREW_FORCE_BREWED_GIT
Because of this messing with the user's path:
https://github.com/Homebrew/brew/blob/
    efc02899c851c62c9ce0d15dea9a231575d7d774/bin/brew#L68
brew uses /usr/bin/git over brewed git, even when the former is
problematically old.
There may also be other reasons a user prefers to use brewed git.

There was already a HOMEBREW_FORCE_BREWED_CURL option and a
HOMEBREW_SYSTEM_CURL_TOO_OLD check to set it. This mostly copies those
to implement HOMEBREW_FORCE_BREWED_GIT & HOMEBREW_SYSTEM_GIT_TOO_OLD.

See also: https://github.com/Linuxbrew/brew/issues/736
2018-06-25 23:36:12 -07:00
Mike McQuaid
34ae75d511 brew.sh: enable linkage cache for developers.
This seems stable on CI so I think we can expose it to more people.
2018-06-11 20:10:40 +01:00
Markus Reiter
c53a52daee Move --version logic into cmd/--version.rb. 2018-05-21 05:35:44 +02:00
Buck Evan
c1403ba933 /bin/cat -> cat
this allows odd linux installations (Android) to function
2018-03-17 17:05:39 -07:00
Mike McQuaid
9446eb661d brew.sh: HOMEBREW_DEVELOPERs can enable Ruby warnings.
It provides some useful helpers for when we're doing stupid things but
it's not something we want around by default.
2018-02-27 11:53:31 +00:00
Mike McQuaid
72f4d05418 Handle a too old system Git on OS X 10.8 and below
Needed for GitHub since:
https://github.com/blog/2507-weak-cryptographic-standards-removed
2018-02-26 16:08:10 +00:00
Mike McQuaid
84be0f82d4 brew.sh: use system curl on Linux where possible.
Result of discussion in #3809.
2018-02-20 09:12:47 +00:00
Maxim Belkin
30d468978f
Unifying Linux/Mac logic that sets HOMEBREW_CURL 2018-02-15 13:26:17 -06:00
Maxim Belkin
e47c364c55
Don't set HOMEBREW_MACOS_VERSION on non-mac systems 2018-02-15 13:09:47 -06:00
Maxim Belkin
e5f4160d3e
brew.sh: changes from Linuxbrew (Linux fork)
These fixes do two things:

- set HOMEBREW_MACOS_VERSION to 0 on non-HOMEBREW_MACOS machines
- set HOMEBREW_CURL to Homebrew'd curl
2018-02-15 11:43:20 -06:00
Markus Reiter
cf4c2bb97a Auto-update on brew cask install/upgrade. 2018-02-13 18:02:54 +01:00
Mike McQuaid
4abae7f7e9 Always install Gems into bundler location. 2018-01-26 22:05:43 +00:00
Shaun Jackman
cf27117c46 brew.sh: Use shims/scm/git for HOMEBREW_VERSION
Move the use of git to determine HOMEBREW_VERSION below the
definition of the function git.
2017-12-20 16:16:01 -08:00
Shaun Jackman
a4033c7196 Do not specify absolute paths to utilities
Specifying an absolute path to utilities is no longer needed,
since environment filtering uses a default PATH.
2017-12-12 09:25:16 -08:00
Mike McQuaid
67a6c51606 brew.sh: latest HOMEBREW_VERSION is 1.4.0 2017-12-11 16:43:11 +00:00
Mike McQuaid
837ea74f44
Merge pull request #3543 from MikeMcQuaid/remove-env-unsets
Remove some unset/checked environment checks
2017-12-10 17:46:29 +00:00
Mike McQuaid
6b9ca5dbf5 Remove some unset/checked environment checks
These will be redundant once environment filtering is on by default
in #3529.
2017-12-08 16:33:33 +00:00
Mike McQuaid
e13a93dd75 Default environment filtering to on for all users. 2017-12-05 14:07:28 +00:00
Mike McQuaid
b26a0d4a91 Enable environment filtering for developers.
If folks have set `HOMEBREW_DEVELOPER` or run a `dev-cmd` then enable
environment filtering by default for them.
2017-11-27 10:15:26 +00:00
Mike McQuaid
a19d0708a4 Allow optionally using Homebrew's curl
If `HOMEBREW_FORCE_BREWED_CURL` is set then allow it to be used instead
of the system `curl`.
2017-11-26 18:17:26 +00:00
Mike McQuaid
5f301755c0 Use HOMEBREW_AUTO_UPDATE_CHECKED variable.
Rather than reusing `HOMEBREW_NO_AUTO_UPDATE` to indicate that we've
already made a check. This allows `HOMEBREW_NO_AUTO_UPDATE` to be
displayed properly by `brew config`.
2017-11-07 08:01:51 +00:00
Mike McQuaid
f999a57620 brew.sh: cleanup some environment pollution. 2017-11-05 14:45:36 +00:00
Mike McQuaid
ca189437e4 Tweak use of with_env
- Use it in more places where it saves code
- Allow using symbolic keys for a cleaner interface
- Use `HOMEBREW_GEM_*` instead of `GEM_OLD_*`
2017-10-29 14:44:43 +00:00
Mike McQuaid
df7fb212c2 brew.sh: update no git repository message.
Clarify that this message doesn’t only trigger when there’s no Git
repository but also when there’s no tags that `git describe` can use.
2017-09-22 15:50:09 +01:00
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