mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Add line breaks & indentation
This commit is contained in:
parent
762b35bbc8
commit
c1531cd7b3
@ -3,15 +3,18 @@
|
|||||||
Homebrew gathers anonymous aggregate user behaviour analytics using Google Analytics. You will be notified the first time you run `brew update` or install Homebrew. Analytics are not enabled until after this notice is shown, to ensure that you can [opt out](Analytics.md#opting-out) without ever sending analytics data.
|
Homebrew gathers anonymous aggregate user behaviour analytics using Google Analytics. You will be notified the first time you run `brew update` or install Homebrew. Analytics are not enabled until after this notice is shown, to ensure that you can [opt out](Analytics.md#opting-out) without ever sending analytics data.
|
||||||
|
|
||||||
## Why?
|
## Why?
|
||||||
|
|
||||||
Homebrew is provided free of charge and run entirely by volunteers in their spare time. As a result, we do not have the resources to do detailed user studies of Homebrew users to decide on how best to design future features and prioritise current work. Anonymous aggregate user analytics allow us to prioritise fixes and features based on how, where and when people use Homebrew. For example:
|
Homebrew is provided free of charge and run entirely by volunteers in their spare time. As a result, we do not have the resources to do detailed user studies of Homebrew users to decide on how best to design future features and prioritise current work. Anonymous aggregate user analytics allow us to prioritise fixes and features based on how, where and when people use Homebrew. For example:
|
||||||
|
|
||||||
- If a formula is widely used and is failing often it will enable us to prioritise fixing that formula over others.
|
- If a formula is widely used and is failing often it will enable us to prioritise fixing that formula over others.
|
||||||
- Collecting the OS version allows us to decide what versions of macOS to prioritise and support and identify build failures that occur only on single versions.
|
- Collecting the OS version allows us to decide what versions of macOS to prioritise and support and identify build failures that occur only on single versions.
|
||||||
|
|
||||||
## How Long?
|
## How Long?
|
||||||
|
|
||||||
Homebrew's anonymous user and event data have a 14 month retention period. This is the [lowest possible value for Google Analytics](https://support.google.com/analytics/answer/7667196).
|
Homebrew's anonymous user and event data have a 14 month retention period. This is the [lowest possible value for Google Analytics](https://support.google.com/analytics/answer/7667196).
|
||||||
|
|
||||||
## What?
|
## What?
|
||||||
|
|
||||||
Homebrew's analytics record some shared information for every event:
|
Homebrew's analytics record some shared information for every event:
|
||||||
|
|
||||||
- The Homebrew user agent, e.g. `Homebrew/2.5.0 (Macintosh; Intel Mac OS X 10.15.6) curl/7.64.1`.
|
- The Homebrew user agent, e.g. `Homebrew/2.5.0 (Macintosh; Intel Mac OS X 10.15.6) curl/7.64.1`.
|
||||||
@ -39,15 +42,19 @@ It is impossible for the Homebrew developers to match any particular event to an
|
|||||||
As far as we can tell it would be impossible for Google to match the randomly generated Homebrew-only analytics user ID to any other Google Analytics user ID. If Google turned evil the only thing they could do would be to lie about anonymising IP addresses and attempt to match users based on IP addresses.
|
As far as we can tell it would be impossible for Google to match the randomly generated Homebrew-only analytics user ID to any other Google Analytics user ID. If Google turned evil the only thing they could do would be to lie about anonymising IP addresses and attempt to match users based on IP addresses.
|
||||||
|
|
||||||
## When/Where?
|
## When/Where?
|
||||||
|
|
||||||
Homebrew's analytics are sent throughout Homebrew's execution to Google Analytics over HTTPS.
|
Homebrew's analytics are sent throughout Homebrew's execution to Google Analytics over HTTPS.
|
||||||
|
|
||||||
## Who?
|
## Who?
|
||||||
|
|
||||||
Summaries of installation and error analytics are publicly available [here](https://brew.sh/analytics/). A JSON API is also available. The majority of Homebrew maintainers are not granted more detailed analytics data beyond these public resources.
|
Summaries of installation and error analytics are publicly available [here](https://brew.sh/analytics/). A JSON API is also available. The majority of Homebrew maintainers are not granted more detailed analytics data beyond these public resources.
|
||||||
|
|
||||||
## How?
|
## How?
|
||||||
|
|
||||||
The code is viewable in [`analytics.rb`](https://github.com/Homebrew/brew/blob/HEAD/Library/Homebrew/utils/analytics.rb) and [`analytics.sh`](https://github.com/Homebrew/brew/blob/HEAD/Library/Homebrew/utils/analytics.sh). They are done in a separate background process and fail fast to avoid delaying any execution. They will fail immediately and silently if you have no network connection.
|
The code is viewable in [`analytics.rb`](https://github.com/Homebrew/brew/blob/HEAD/Library/Homebrew/utils/analytics.rb) and [`analytics.sh`](https://github.com/Homebrew/brew/blob/HEAD/Library/Homebrew/utils/analytics.sh). They are done in a separate background process and fail fast to avoid delaying any execution. They will fail immediately and silently if you have no network connection.
|
||||||
|
|
||||||
## Opting out
|
## Opting out
|
||||||
|
|
||||||
Homebrew analytics helps us maintainers and leaving it on is appreciated. However, if you want to opt out of Homebrew's analytics, you can set this variable in your environment:
|
Homebrew analytics helps us maintainers and leaving it on is appreciated. However, if you want to opt out of Homebrew's analytics, you can set this variable in your environment:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
@ -3,19 +3,23 @@
|
|||||||
Bottles are produced by installing a formula with `brew install --build-bottle <formula>` and then bottling it with `brew bottle <formula>`. This outputs the bottle DSL which should be inserted into the formula file.
|
Bottles are produced by installing a formula with `brew install --build-bottle <formula>` and then bottling it with `brew bottle <formula>`. This outputs the bottle DSL which should be inserted into the formula file.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
If a bottle is available and usable it will be downloaded and poured automatically when you `brew install <formula>`. If you wish to disable this you can do so by specifying `--build-from-source`.
|
If a bottle is available and usable it will be downloaded and poured automatically when you `brew install <formula>`. If you wish to disable this you can do so by specifying `--build-from-source`.
|
||||||
|
|
||||||
Bottles will not be used if the user requests it (see above), if the formula requests it (with `pour_bottle?`), if any options are specified during installation (bottles are all compiled with default options), if the bottle is not up to date (e.g. lacking a checksum) or if the bottle's `cellar` is not `:any` nor equal to the current `HOMEBREW_CELLAR`.
|
Bottles will not be used if the user requests it (see above), if the formula requests it (with `pour_bottle?`), if any options are specified during installation (bottles are all compiled with default options), if the bottle is not up to date (e.g. lacking a checksum) or if the bottle's `cellar` is not `:any` nor equal to the current `HOMEBREW_CELLAR`.
|
||||||
|
|
||||||
## Creation
|
## Creation
|
||||||
|
|
||||||
Bottles are created using the [Brew Test Bot](Brew-Test-Bot.md), usually when people submit pull requests to Homebrew. The `bottle do` block is updated by maintainers when they merge a pull request. For the Homebrew organisations' taps they are uploaded to and downloaded from [GitHub Packages](https://github.com/orgs/Homebrew/packages).
|
Bottles are created using the [Brew Test Bot](Brew-Test-Bot.md), usually when people submit pull requests to Homebrew. The `bottle do` block is updated by maintainers when they merge a pull request. For the Homebrew organisations' taps they are uploaded to and downloaded from [GitHub Packages](https://github.com/orgs/Homebrew/packages).
|
||||||
|
|
||||||
By default, bottles will be built for the oldest CPU supported by the OS/architecture you're building for (Core 2 for 64-bit OSs). This ensures that bottles are compatible with all computers you might distribute them to. If you *really* want your bottles to be optimised for something else, you can pass the `--bottle-arch=` option to build for another architecture; for example, `brew install foo --build-bottle --bottle-arch=penryn`. Just remember that if you build for a newer architecture some of your users might get binaries they can't run and that would be sad!
|
By default, bottles will be built for the oldest CPU supported by the OS/architecture you're building for (Core 2 for 64-bit OSs). This ensures that bottles are compatible with all computers you might distribute them to. If you *really* want your bottles to be optimised for something else, you can pass the `--bottle-arch=` option to build for another architecture; for example, `brew install foo --build-bottle --bottle-arch=penryn`. Just remember that if you build for a newer architecture some of your users might get binaries they can't run and that would be sad!
|
||||||
|
|
||||||
## Format
|
## Format
|
||||||
|
|
||||||
Bottles are simple gzipped tarballs of compiled binaries. Any metadata is stored in a formula's bottle DSL and in the bottle filename (i.e. macOS version, revision).
|
Bottles are simple gzipped tarballs of compiled binaries. Any metadata is stored in a formula's bottle DSL and in the bottle filename (i.e. macOS version, revision).
|
||||||
|
|
||||||
## Bottle DSL (Domain Specific Language)
|
## Bottle DSL (Domain Specific Language)
|
||||||
|
|
||||||
Bottles have a DSL to be used in formulae which is contained in the `bottle do ... end` block.
|
Bottles have a DSL to be used in formulae which is contained in the `bottle do ... end` block.
|
||||||
|
|
||||||
A simple (and typical) example:
|
A simple (and typical) example:
|
||||||
@ -43,25 +47,35 @@ end
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Root URL (`root_url`)
|
### Root URL (`root_url`)
|
||||||
|
|
||||||
Optionally contains the URL root used to calculate bottle URLs.
|
Optionally contains the URL root used to calculate bottle URLs.
|
||||||
|
|
||||||
By default this is omitted and the Homebrew default bottle URL root is used. This may be useful for taps which wish to provide bottles for their formulae or to cater for a non-default `HOMEBREW_CELLAR`.
|
By default this is omitted and the Homebrew default bottle URL root is used. This may be useful for taps which wish to provide bottles for their formulae or to cater for a non-default `HOMEBREW_CELLAR`.
|
||||||
|
|
||||||
### Cellar (`cellar`)
|
### Cellar (`cellar`)
|
||||||
|
|
||||||
Optionally contains the value of `HOMEBREW_CELLAR` in which the bottles were built.
|
Optionally contains the value of `HOMEBREW_CELLAR` in which the bottles were built.
|
||||||
|
|
||||||
Most compiled software contains references to its compiled location so cannot be simply relocated anywhere on disk. If this value is `:any` or `:any_skip_relocation` this means that the bottle can be safely installed in any Cellar as it did not contain any references to its installation Cellar. This can be omitted if a bottle is compiled (as all default Homebrew ones are) for the default `HOMEBREW_CELLAR`.
|
Most compiled software contains references to its compiled location so cannot be simply relocated anywhere on disk. If this value is `:any` or `:any_skip_relocation` this means that the bottle can be safely installed in any Cellar as it did not contain any references to its installation Cellar. This can be omitted if a bottle is compiled (as all default Homebrew ones are) for the default `HOMEBREW_CELLAR`.
|
||||||
|
|
||||||
### Rebuild version (`rebuild`)
|
### Rebuild version (`rebuild`)
|
||||||
|
|
||||||
Optionally contains the rebuild version of the bottle.
|
Optionally contains the rebuild version of the bottle.
|
||||||
|
|
||||||
Sometimes bottles may need be updated without bumping the version of the formula, e.g. a new patch was applied. In that case the rebuild will have a value of 1 or more.
|
Sometimes bottles may need be updated without bumping the version of the formula, e.g. a new patch was applied. In that case the rebuild will have a value of 1 or more.
|
||||||
|
|
||||||
### Checksum (`sha256`)
|
### Checksum (`sha256`)
|
||||||
|
|
||||||
Contains the SHA-256 hash of a bottle for a particular version of macOS.
|
Contains the SHA-256 hash of a bottle for a particular version of macOS.
|
||||||
|
|
||||||
## Formula DSL
|
## Formula DSL
|
||||||
|
|
||||||
An additional method is available in the formula DSL.
|
An additional method is available in the formula DSL.
|
||||||
|
|
||||||
### Pour bottle (`pour_bottle?`)
|
### Pour bottle (`pour_bottle?`)
|
||||||
|
|
||||||
Optionally returns a boolean to decide whether a bottle should be used for this formula.
|
Optionally returns a boolean to decide whether a bottle should be used for this formula.
|
||||||
|
|
||||||
For example a bottle may break if another formula has been compiled with non-default options, so this method could check for that case and return `false`.
|
For example a bottle may break if another formula has been compiled with non-default options, so this method could check for that case and return `false`.
|
||||||
|
|
||||||
A full example:
|
A full example:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Interesting Taps & Forks
|
# Interesting Taps & Forks
|
||||||
|
|
||||||
A [tap](Taps.md) is Homebrew-speak for a Git repository containing extra formulae.
|
A [tap](Taps.md) is Homebrew-speak for a Git repository containing extra formulae.
|
||||||
|
|
||||||
Homebrew has the capability to add (and remove) multiple taps to your local installation with the `brew tap` and `brew untap` commands. Type `man brew` in your terminal. The main repository at <https://github.com/Homebrew/homebrew-core>, often called `homebrew/core`, is always built-in.
|
Homebrew has the capability to add (and remove) multiple taps to your local installation with the `brew tap` and `brew untap` commands. Type `man brew` in your terminal. The main repository at <https://github.com/Homebrew/homebrew-core>, often called `homebrew/core`, is always built-in.
|
||||||
|
|
||||||
Your taps are Git repositories located at `$(brew --repository)/Library/Taps`.
|
Your taps are Git repositories located at `$(brew --repository)/Library/Taps`.
|
||||||
|
@ -18,12 +18,14 @@ dunn/emacs
|
|||||||
|
|
||||||
<!-- vale Homebrew.Terms = OFF -->
|
<!-- vale Homebrew.Terms = OFF -->
|
||||||
<!-- The `terms` lint suggests changing "repo" to "repository". But we need the abbreviation in the tap syntax and URL example. -->
|
<!-- The `terms` lint suggests changing "repo" to "repository". But we need the abbreviation in the tap syntax and URL example. -->
|
||||||
|
|
||||||
* `brew tap <user/repo>` makes a clone of the repository at
|
* `brew tap <user/repo>` makes a clone of the repository at
|
||||||
https://github.com/user/homebrew-repo. After that, `brew` will be able to work on
|
https://github.com/user/homebrew-repo. After that, `brew` will be able to work on
|
||||||
those formulae as if they were in Homebrew's canonical repository. You can
|
those formulae as if they were in Homebrew's canonical repository. You can
|
||||||
install and uninstall them with `brew [un]install`, and the formulae are
|
install and uninstall them with `brew [un]install`, and the formulae are
|
||||||
automatically updated when you run `brew update`. (See below for details
|
automatically updated when you run `brew update`. (See below for details
|
||||||
about how `brew tap` handles the names of repositories.)
|
about how `brew tap` handles the names of repositories.)
|
||||||
|
|
||||||
<!-- vale Homebrew.Terms = ON -->
|
<!-- vale Homebrew.Terms = ON -->
|
||||||
|
|
||||||
* `brew tap <user/repo> <URL>` makes a clone of the repository at URL.
|
* `brew tap <user/repo> <URL>` makes a clone of the repository at URL.
|
||||||
|
@ -16,6 +16,7 @@ This can be useful if a package can't build against the version of something you
|
|||||||
And of course, you can simply `brew link <formula>` again afterwards!
|
And of course, you can simply `brew link <formula>` again afterwards!
|
||||||
|
|
||||||
## Pre-downloading a file for a formula
|
## Pre-downloading a file for a formula
|
||||||
|
|
||||||
Sometimes it's faster to download a file via means other than those
|
Sometimes it's faster to download a file via means other than those
|
||||||
strategies that are available as part of Homebrew. For example,
|
strategies that are available as part of Homebrew. For example,
|
||||||
Erlang provides a torrent that'll let you download at 4–5× the normal
|
Erlang provides a torrent that'll let you download at 4–5× the normal
|
||||||
@ -80,10 +81,12 @@ In Sublime Text 2/3, you can use Package Control to install
|
|||||||
which adds highlighting for inline patches.
|
which adds highlighting for inline patches.
|
||||||
|
|
||||||
### Vim
|
### Vim
|
||||||
|
|
||||||
[brew.vim](https://github.com/xu-cheng/brew.vim) adds highlighting to
|
[brew.vim](https://github.com/xu-cheng/brew.vim) adds highlighting to
|
||||||
inline patches in Vim.
|
inline patches in Vim.
|
||||||
|
|
||||||
### Emacs
|
### Emacs
|
||||||
|
|
||||||
[homebrew-mode](https://github.com/dunn/homebrew-mode) provides syntax
|
[homebrew-mode](https://github.com/dunn/homebrew-mode) provides syntax
|
||||||
highlighting for inline patches as well as a number of helper functions
|
highlighting for inline patches as well as a number of helper functions
|
||||||
for editing formula files.
|
for editing formula files.
|
||||||
@ -92,6 +95,7 @@ for editing formula files.
|
|||||||
for emacs shell-mode and eshell-mode.
|
for emacs shell-mode and eshell-mode.
|
||||||
|
|
||||||
### Atom
|
### Atom
|
||||||
|
|
||||||
[language-homebrew-formula](https://atom.io/packages/language-homebrew-formula)
|
[language-homebrew-formula](https://atom.io/packages/language-homebrew-formula)
|
||||||
adds highlighting and diff support (with the
|
adds highlighting and diff support (with the
|
||||||
[language-diff](https://atom.io/packages/language-diff) plugin).
|
[language-diff](https://atom.io/packages/language-diff) plugin).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user