1739 Commits

Author SHA1 Message Date
Xu Cheng
7aaaf9d8db fix setup-analytics (#154)
DO not invoke git config because HOMEBREW_NO_ANALYTICS, otherwise
it will disable analytics for everyone when running `brew update`
in following manners:
 * `brew update` will set HOMEBREW_NO_ANALYTICS because the absence of
   `homebrew.analyticsmessage`
 * `brew update-report` will set `homebrew.analyticsdisabled` because of
    HOMEBREW_NO_ANALYTICS.

Also reduce file IO.
2016-04-26 15:53:52 +08:00
Mike McQuaid
df489cfde2 More analytics tweaks.
Provide a single command that can be run to disable analytics, run it if
`HOMEBREW_NO_ANALYTICS` is ever set and remove the user UUID file in
that case too.

References https://github.com/Homebrew/brew/issues/142.
2016-04-25 18:51:00 -05:00
Mike McQuaid
1451553188 Ship analytics for Homebrew.
For more information and opt-out instructions please read:
https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Analytics.md#analytics
2016-04-23 14:27:09 +01:00
Andrew Janke
a3b70d38a7 brew-audit: pull style checks in to main audit output
This collects all violations for each formula in a single place, instead
of doing `brew style` outputs for all formulae first, and then the other
audit checks.

Closes #112.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-21 14:45:33 -04:00
Mike McQuaid
2671b9f55d analytics: roll tracking ID.
Someone else has been sending weird data to ours and it has bad initial
test data so let's roll it before we ship it to everyone on Saturday.
2016-04-21 08:06:12 +01:00
Mike McQuaid
f6d5ae2253 analytics: add more documentation, Linuxbrew ID. (#98) 2016-04-16 11:39:57 +01:00
Mike McQuaid
4e8c6e633c Document disabling of opt-in Homebrew analytics. (#79) 2016-04-12 12:17:56 +01:00
Mike McQuaid
0c85113053 Homebrew (opt-in) Analytics tweaks. (#57)
- add `HOMEBREW_PRODUCT` global variable
- only differentiate between `/usr/local` and `non-/usr/local` Homebrew
  prefixes to avoid sharing sensitive user information
- note if e.g. build errors are occurring under CI
- Add `HOMEBREW_NO_ANALYTICS` variable (this will be how people opt-out
  when this is enabled for everyone)
- Add `HOMEBREW_ANALYTICS_DEBUG` variable to output all the analytics
  that are sent
- Move Bash analytics code to `Library/Homebrew/utils/analytics.sh`
- Add documentation for our analytics and why/what/when/how and opt-out
- Only official Homebrew commands are reported
- Ruby analytics are now reported in a forked, background process
2016-04-12 11:02:22 +01:00
Martin Afanasjew
8ab2fb6868 analytics: avoid unnecessary string interpolation 2016-04-07 08:25:41 +02:00
Martin Afanasjew
e747648c53 always prefer HOMEBREW_CURL over plain 'curl' 2016-04-07 08:25:41 +02:00
Carlos D'Agostino
fa3c55aa65 utils/analytics: fix usage of undefined variable. 2016-04-04 17:14:03 +01:00
Mike McQuaid
1238c65ba1 utils: add analytics functions. 2016-04-04 12:27:47 +01:00
Xu Cheng
5560f5550d git: check homebrew/core existence before installing brewed git 2016-04-02 21:51:36 +08:00
Xu Cheng
e0e277ecde utils/git: various improvement
* Use `ENV/scm/git` to check whether git is installed.
* Use `brew install git` to enforce pre-install checks such as sudo
  check.
2016-03-21 19:07:38 +08:00
Baptiste Fontaine
169b8fc039 Revert "minor perf improvements"
This reverts commit 16a2a8274a7808e63a6c78475e12a7c0ef5812ef.
2015-12-26 23:00:38 +01:00
Baptiste Fontaine
48681c3f3a minor perf improvements
Closes Homebrew/homebrew#47224.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-26 22:58:26 +01:00
Xu Cheng
3638c057f0 FormulaInstaller: reset git_available? when installing git
Closes Homebrew/homebrew#43693

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-09 12:22:03 +08:00
Xu Cheng
c8efb05826 doctor: use Utils.git_available? instead of git? 2015-09-09 12:21:08 +08:00
Xu Cheng
4529df1246 git_available?: cache the result 2015-09-09 12:19:16 +08:00
Xu Cheng
71f794260b add git utils
Two methods:
* `Utils.git_available?` checks whether git is installed.
* `Utils.ensure_git_installed!` installs git for users who don't install
  Xcode or CLT.
2015-09-02 15:24:52 +08:00
Mike McQuaid
2c959a7d58 More API documentation.
And remove the documented stuff from the `example-formula.rb`.

Closes Homebrew/homebrew#43241.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-29 15:43:16 +01: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
Jack Nagel
ff11789933 Close the socket after sending the file descriptor to the child
Fixes Homebrew/homebrew#39691.
2015-05-12 21:53:04 -04:00
Jack Nagel
c07da9485f The forked build process should never run at_exit handlers
We don't use at_exit anywhere that matters, but the test framework does.
2015-04-28 01:39:28 -04:00
Jack Nagel
913c12fd43 Keep subprocess code inside begin block 2015-04-25 23:22:58 -04:00
Jack Nagel
f7ded45bc7 Clean up socket and filesystem resources separately 2015-04-25 23:17:13 -04:00
Xu Cheng
06f72ab38f move safe_fork into a standalone method 2015-04-15 19:51:54 +08:00
Jack Nagel
aaaab946ec Make inreplace errors fatal
Closes Homebrew/homebrew#32649.
Closes Homebrew/homebrew#32703.
2014-09-28 01:11:31 -05:00
Jack Nagel
5c24b7330b Read if no block is passed to Utils.popen_read 2014-07-11 15:52:39 -05:00
Jack Nagel
ad27b21cd1 Add popen wrapper that does not invoke the shell 2014-07-05 13:50:54 -05:00
Jack Nagel
4fd63dc4f8 Expose inreplace as a class method 2014-06-18 19:25:35 -05:00
Jack Nagel
7b389fbfed Replace files atomically in inreplace 2014-03-26 16:07:49 -05:00
Jack Nagel
4fe0be37c0 Drop intermediate variable 2014-03-26 16:07:49 -05:00
Mike McQuaid
be3e60fc95 inreplace: odie for Homebrew developers. 2013-11-12 15:44:30 +00:00
Shaun Jackman
91e6c993f8 inreplace: Open the file as binary
Closes Homebrew/homebrew#22628.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-09-17 13:58:34 -05:00
Jason Whittle
2c23e71be3 let inreplace take a symbol
As discussed in https://github.com/mxcl/homebrew/pull/21936

Closes Homebrew/homebrew#21942.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-08-17 07:40:27 -07:00
Jack Nagel
c8e79c3309 Move inreplace off of Object
Closes Homebrew/homebrew#21163.
2013-07-12 16:23:06 -05:00
Jack Nagel
d6929f96a5 Use OkJson directly 2013-06-22 21:34:03 -05:00
Jack Nagel
083b3c84d0 Add Utils::JSON to wrap the JSON implementation 2013-06-22 21:34:02 -05:00