92 Commits

Author SHA1 Message Date
Mike McQuaid
6417332a3a Change Mojave bottle behaviour
Rather than relying on a `HOMEBREW_FORCE_BOTTLE` variable (which ends
up doing silly things like forcing bottle usage even when options are
provided) instead handle this at the `or_later` bottle detection
level so on prerelease versions of macOS any bottle looks like an
`or_later` bottle (unless various environment variables are set).

Fixes issues noted in:
https://github.com/Homebrew/brew/pull/4520#issuecomment-407229605
2018-07-24 09:25:32 +01:00
Mike McQuaid
3e93d4c6cf Add HOMEBREW_FORCE_BOTTLE variable
This does the equivalent of always passing `--force-bottle`. This will
be enabled by default on Mojave to allow people to avoid building
everything from source until our porting and bottling is a bit further
along.
2018-07-20 14:28:14 +01:00
Mike McQuaid
f46e4596c0 Cleanup HOMEBREW_TEMP handling
- Ensure that `HOMEBREW_TEMP` is only displayed in `brew config` when
  it's non-default.
- Attempt to create a missing `HOMEBREW_TEMP` directory rather than
  failing to `realpath`. Note this will still fail on permissions errors
  which is to be expected.
2018-07-03 15:41:33 +01:00
Mike McQuaid
09ee556833
Merge pull request #4397 from woodruffw/forbid-temp-prefix
brew.sh: Don't allow system tmp dirs as prefixes
2018-07-03 08:31:40 +01:00
William Woodruff
fd014153e6
brew.sh: Upcase var, tweak error language 2018-07-02 19:34:19 -04:00
William Woodruff
68d3dc1368
brew.sh: Only do tmpdir check on macOS 2018-07-01 19:21:50 -04:00
William Woodruff
bde7c6b82b
brew.sh: Use bashisms for default values 2018-07-01 19:19:55 -04:00
William Woodruff
039a4ee4b3
brew.sh: Move HOMEBREW_TEMP declaration
Additionally, assign HOMEBREW_TEMP based on the host
system (/tmp for Linux, /private/tmp for macOS).
2018-07-01 12:58:32 -04:00
William Woodruff
8e4aab92aa
brew.sh: Test HOMEBREW_TEMP, not hardcoded tmpdir 2018-06-30 12:21:32 -04:00
William Woodruff
c552e6596c
brew.sh: Remove trailing / from prefix in message 2018-06-30 11:53:29 -04:00
William Woodruff
b6a0b04a39
brew.sh: Tweak language 2018-06-30 11:13:39 -04:00
William Woodruff
42bd5448bc
brew.sh: Typo 2018-06-30 09:47:55 -04:00
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