11 Commits

Author SHA1 Message Date
Martin Afanasjew
15b42301e5 brew.sh: make analytics 'curl' fully asynchronous
If analytics are enabled and `brew` is used in a command substitution
context, e.g. `brew search` for tab completion, the result is that even
though the Google Analytics `curl` process runs in the background it
still is attached to the captured `stdout`, thus could theoretically
contribute to the result of the command substitution and consequently
makes the command substitution block on the completion of this process.
Redirecting `stdout` (and `stderr` for good measure) to `/dev/null`
makes this process truly asynchronous in these contexts.

Furthermore, even if the process is in the background, it is still
included in the shell's job list and thus shell internals like `wait`
(used in `cmd/update.sh`) have to wait on this process, even if they
never intended to do so. Removing the analytics process from the job
list via `disown` avoids this unintended effect.

Fixes #29.

Closes #34.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-06 10:28:06 +02:00
Mike McQuaid
0b79f48aad Add opt-in Google Analytics.
Add the first Google Analytics usage to monitor the command names that
are run by Homebrew.
2016-04-04 12:25:11 +01:00
Mike McQuaid
77611bafb1 Make Homebrew user agent consistent, use a slash.
Generally it seems user agents are all `software/version` but ours is
not. Also, set the user agent in a way that it's shared between Bash
and Ruby code.

Closes https://github.com/Homebrew/legacy-homebrew/pull/50480.
2016-04-04 12:18:21 +01:00
Xu Cheng
edf000e4cd Core/formula separation Part 2(b)
* move shell completion scripts to where can be auto picked up

Let's use switching new remote as opportunity to put shell completion
scripts to where they should be and avoid git conflict during the process.

* add Library/Formula and Library/Aliases symlinks

Formulae and Aliases has been relocated to homebrew/core tap.
The symlinks are pointed to new location to keep backward compatibility.

* remove formula_renames and tap_migrations

They have been replaced by the json files in the core tap.

* update: set new remote

* bump Homebrew version to 0.9.9
2016-04-03 18:34:17 +08:00
Xu Cheng
1084b53d52 bump Homebrew version to 0.9.8
So we can know whether a Homebrew installation is pre or post
core/formula separation.

Will update to 0.9.9 when moving core code to new repo.
2016-04-02 21:51:36 +08:00
Mike McQuaid
2c3a7e8c75 Fix brew update user agent.
This needs to be `Homebrew $HOMEBREW_VERSION` so we can be adequately
filtered.

Closes Homebrew/homebrew#49961.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-03-11 13:32:54 +08:00
Xu Cheng
e8caa48cc2 brew.sh: add tap-pin to sudo check list 2016-03-09 19:35:41 +08:00
Martin Afanasjew
bd679c7dc3 brew.sh: improve empty argument handling
Follow-up to Homebrew/homebrew#49327 that leaves empty argument handling to the Ruby code
(it is a bit more sophisticated and distinguished between `help` and an
empty argument list and treats them differently) instead of hard-wiring
the former to the `help` command.

Closes Homebrew/homebrew#49538.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-02-27 18:34:31 +01:00
Martin Afanasjew
2ab4f74527 brew.sh: drop reference to removed 'update-ruby'
This is a follow-up fix to a minor oversight in Homebrew/homebrew#49523.
2016-02-26 14:33:40 +01:00
Misty De Meo
d431f20d88 brew: print help when no commands given
Fixes Homebrew/homebrew#49325.

Closes Homebrew/homebrew#49327.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-19 09:04:22 +00:00
Mike McQuaid
691e4aec11 bin/brew: move logic to Library.
`bin/brew` is getting a bit bloated and it's annoying to open all of
`HOMEBREW_PREFIX` in your editor of choice and have it search through
the `Cellar`. Let's instead keep the bare minimum in `bin/brew` and
move the rest to `Library`.

Closes Homebrew/homebrew#49185.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-16 09:31:58 +00:00