From b04a5ffa0b8009961475ae9ec70872b63bf96bff Mon Sep 17 00:00:00 2001 From: metacollin Date: Sat, 24 Oct 2020 18:34:03 -0600 Subject: [PATCH 01/15] Turbocharged formula name completion --- Library/Homebrew/brew.sh | 13 +++++++------ Library/Homebrew/cmd/formulae.sh | 11 +++++++++++ completions/bash/brew | 5 ++--- completions/fish/brew.fish | 2 +- completions/internal_commands_list.txt | 1 + completions/zsh/_brew | 3 ++- docs/Manpage.md | 4 ++++ manpages/brew.1 | 3 +++ 8 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 Library/Homebrew/cmd/formulae.sh diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index d0b15e080f..f5d1a91739 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -38,12 +38,13 @@ HOMEBREW_TEMP="${HOMEBREW_TEMP:-${HOMEBREW_DEFAULT_TEMP}}" # Don't need shellcheck to follow these `source`. # shellcheck disable=SC1090 case "$*" in - --prefix) echo "$HOMEBREW_PREFIX"; exit 0 ;; - --cellar) echo "$HOMEBREW_CELLAR"; exit 0 ;; - --repository|--repo) echo "$HOMEBREW_REPOSITORY"; exit 0 ;; - --caskroom) echo "$HOMEBREW_PREFIX/Caskroom"; exit 0 ;; - --cache) echo "$HOMEBREW_CACHE"; exit 0 ;; - shellenv) source "$HOMEBREW_LIBRARY/Homebrew/cmd/shellenv.sh"; homebrew-shellenv; exit 0 ;; + --prefix) echo "$HOMEBREW_PREFIX"; exit 0 ;; + --cellar) echo "$HOMEBREW_CELLAR"; exit 0 ;; + --repository|--repo) echo "$HOMEBREW_REPOSITORY"; exit 0 ;; + --caskroom) echo "$HOMEBREW_PREFIX/Caskroom"; exit 0 ;; + --cache) echo "$HOMEBREW_CACHE"; exit 0 ;; + shellenv) source "$HOMEBREW_LIBRARY/Homebrew/cmd/shellenv.sh"; homebrew-shellenv; exit 0 ;; + formulae|formulas) source "$HOMEBREW_LIBRARY/Homebrew/cmd/formulae.sh"; homebrew-formulae; exit 0 ;; esac ##### diff --git a/Library/Homebrew/cmd/formulae.sh b/Library/Homebrew/cmd/formulae.sh new file mode 100644 index 0000000000..d333097632 --- /dev/null +++ b/Library/Homebrew/cmd/formulae.sh @@ -0,0 +1,11 @@ +#: * `formulae` +#: +#: Prints a sorted list of locally available formulas including shortnames. +#: + +# shellcheck disable=SC2155 +homebrew-formulae() { + local formulae="$(find "$HOMEBREW_REPOSITORY"/Library/Taps -type d \( -name Casks -o -name cmd -o -name .github \) -prune -false -o -name '*rb' | sed 's/\.rb//g' | sed -E 's .*/Taps/(.*)/homebrew- \1/ g' | sed 's /Formula/ / g')" + local shortnames="$(echo "$formulae" | cut -d / -f 3)" + echo -e "$formulae \n $shortnames" | grep -v '^homebrew/' | sort -uf +} \ No newline at end of file diff --git a/completions/bash/brew b/completions/bash/brew index f20533bbf4..49eed71526 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -50,9 +50,8 @@ __brewcomp() { # it is too slow and is not worth it just for duplicate elimination. __brew_complete_formulae() { local cur="${COMP_WORDS[COMP_CWORD]}" - local formulas="$(brew search)" - local shortnames="$(echo "$formulas" | \grep / | \cut -d / -f 3)" - COMPREPLY=($(compgen -W "$formulas $shortnames" -- "$cur")) + local formulae="$(brew formulae)" + COMPREPLY=($(compgen -W "$formulae" -- "$cur")) } __brew_complete_installed() { diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index 2e862fb533..c5894b5cb6 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -99,7 +99,7 @@ function __fish_brew_suggest_formulae_all -d 'Lists all available formulae with '.each{ |k, v| puts([k, v].reject(&:nil?).join("\t")) }' # backup: (note that it lists only formulae names without descriptions) else - brew search + brew formulae end end diff --git a/completions/internal_commands_list.txt b/completions/internal_commands_list.txt index 0d277a1200..9c91e9f1f3 100644 --- a/completions/internal_commands_list.txt +++ b/completions/internal_commands_list.txt @@ -37,6 +37,7 @@ environment extract fetch formula +formulae gist-logs help home diff --git a/completions/zsh/_brew b/completions/zsh/_brew index 1ff67fac63..3654ee7a57 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -54,7 +54,7 @@ __brew_formulae() { local -a list local comp_cachename=brew_formulae if ! _retrieve_cache $comp_cachename; then - list=( $(brew search) ) + list=( $(brew formulae) ) _store_cache $comp_cachename list fi _describe -t formulae 'all formulae' list @@ -111,6 +111,7 @@ __brew_common_commands() { 'edit:edit a formula' 'fetch:download formula resources to the cache' 'formula:the path for a formula' + 'formulas:show a sorted list of installable formulas' 'gist-logs:generate a gist of the full build logs' 'home:visit the homepage of a formula or the brew project' 'info:information about a formula' diff --git a/docs/Manpage.md b/docs/Manpage.md index 4fb7f93ab7..320050e31f 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -240,6 +240,10 @@ For tarballs, also print SHA-256 checksums. * `--force-bottle`: Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation. +### `formulae` + +Prints a sorted list of locally available formulas including shortnames. + ### `gist-logs` [*`options`*] *`formula`* Upload logs for a failed build of *`formula`* to a new Gist. Presents an diff --git a/manpages/brew.1 b/manpages/brew.1 index d62b6a8664..1651219fa9 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -336,6 +336,9 @@ Download source packages (for eventual bottling) rather than a bottle\. \fB\-\-force\-bottle\fR Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation\. . +.SS "\fBformulae\fR" +Prints a sorted list of locally available formulas including shortnames\. +. .SS "\fBgist\-logs\fR [\fIoptions\fR] \fIformula\fR" Upload logs for a failed build of \fIformula\fR to a new Gist\. Presents an error message if no logs are found\. . From c176f28f391dba43e882a5e92bf1edd4aac26216 Mon Sep 17 00:00:00 2001 From: metacollin Date: Thu, 19 Nov 2020 20:18:08 -0700 Subject: [PATCH 02/15] Added fixes. --- Library/Homebrew/cmd/formulae.sh | 10 +++++----- completions/zsh/_brew | 2 +- docs/Manpage.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/cmd/formulae.sh b/Library/Homebrew/cmd/formulae.sh index d333097632..bf102bdb30 100644 --- a/Library/Homebrew/cmd/formulae.sh +++ b/Library/Homebrew/cmd/formulae.sh @@ -1,11 +1,11 @@ -#: * `formulae` -#: +#: * `formulae` [] +#: #: Prints a sorted list of locally available formulas including shortnames. #: # shellcheck disable=SC2155 homebrew-formulae() { - local formulae="$(find "$HOMEBREW_REPOSITORY"/Library/Taps -type d \( -name Casks -o -name cmd -o -name .github \) -prune -false -o -name '*rb' | sed 's/\.rb//g' | sed -E 's .*/Taps/(.*)/homebrew- \1/ g' | sed 's /Formula/ / g')" - local shortnames="$(echo "$formulae" | cut -d / -f 3)" - echo -e "$formulae \n $shortnames" | grep -v '^homebrew/' | sort -uf + local formulae="$(\find "$HOMEBREW_REPOSITORY"/Library/Taps -type d \( -name Casks -o -name cmd -o -name .github \) -prune -false -o -name '*rb' | \sed -E -e 's/\.rb//g' -e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' -e 's|/Formula/|/|')" + local shortnames="$(echo "$formulae" | \cut -d / -f 3)" + echo -e "$formulae \n $shortnames" | \grep -v '^homebrew/' | \sort -uf } \ No newline at end of file diff --git a/completions/zsh/_brew b/completions/zsh/_brew index 3654ee7a57..9dbb17e38c 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -111,7 +111,7 @@ __brew_common_commands() { 'edit:edit a formula' 'fetch:download formula resources to the cache' 'formula:the path for a formula' - 'formulas:show a sorted list of installable formulas' + 'formulae:show a sorted list of installable formulae' 'gist-logs:generate a gist of the full build logs' 'home:visit the homepage of a formula or the brew project' 'info:information about a formula' diff --git a/docs/Manpage.md b/docs/Manpage.md index 320050e31f..4f3c8931a7 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -242,7 +242,7 @@ For tarballs, also print SHA-256 checksums. ### `formulae` -Prints a sorted list of locally available formulas including shortnames. +List all locally available formulae including short names. ### `gist-logs` [*`options`*] *`formula`* From e5f7285260d7352e36d685c0b648702ba0671b3e Mon Sep 17 00:00:00 2001 From: metacollin Date: Thu, 19 Nov 2020 20:24:07 -0700 Subject: [PATCH 03/15] Removed plural alias --- Library/Homebrew/brew.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index f5d1a91739..966e048f04 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -44,7 +44,7 @@ case "$*" in --caskroom) echo "$HOMEBREW_PREFIX/Caskroom"; exit 0 ;; --cache) echo "$HOMEBREW_CACHE"; exit 0 ;; shellenv) source "$HOMEBREW_LIBRARY/Homebrew/cmd/shellenv.sh"; homebrew-shellenv; exit 0 ;; - formulae|formulas) source "$HOMEBREW_LIBRARY/Homebrew/cmd/formulae.sh"; homebrew-formulae; exit 0 ;; + formulae) source "$HOMEBREW_LIBRARY/Homebrew/cmd/formulae.sh"; homebrew-formulae; exit 0 ;; esac ##### From 7102cc84b98b889fbab56b85dbb0eca7609db470 Mon Sep 17 00:00:00 2001 From: metacollin Date: Thu, 19 Nov 2020 20:27:19 -0700 Subject: [PATCH 04/15] Documentation wording fixes --- Library/Homebrew/cmd/formulae.sh | 6 +++--- docs/Manpage.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cmd/formulae.sh b/Library/Homebrew/cmd/formulae.sh index bf102bdb30..8bd57bf736 100644 --- a/Library/Homebrew/cmd/formulae.sh +++ b/Library/Homebrew/cmd/formulae.sh @@ -1,6 +1,6 @@ #: * `formulae` [] -#: -#: Prints a sorted list of locally available formulas including shortnames. +#: +#: List all locally installable formulae including short names. #: # shellcheck disable=SC2155 @@ -8,4 +8,4 @@ homebrew-formulae() { local formulae="$(\find "$HOMEBREW_REPOSITORY"/Library/Taps -type d \( -name Casks -o -name cmd -o -name .github \) -prune -false -o -name '*rb' | \sed -E -e 's/\.rb//g' -e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' -e 's|/Formula/|/|')" local shortnames="$(echo "$formulae" | \cut -d / -f 3)" echo -e "$formulae \n $shortnames" | \grep -v '^homebrew/' | \sort -uf -} \ No newline at end of file +} diff --git a/docs/Manpage.md b/docs/Manpage.md index 69a73fbb43..c78ef52bd4 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -223,7 +223,7 @@ For tarballs, also print SHA-256 checksums. ### `formulae` -List all locally available formulae including short names. +List all locally installable formulae including short names. ### `gist-logs` [*`options`*] *`formula`* From 917b4b964fc210446feeed87cb90577a804588c6 Mon Sep 17 00:00:00 2001 From: metacollin Date: Thu, 19 Nov 2020 20:33:18 -0700 Subject: [PATCH 05/15] Declare local variables seperately, split up line for readability. --- Library/Homebrew/cmd/formulae.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cmd/formulae.sh b/Library/Homebrew/cmd/formulae.sh index 8bd57bf736..f543def388 100644 --- a/Library/Homebrew/cmd/formulae.sh +++ b/Library/Homebrew/cmd/formulae.sh @@ -3,9 +3,11 @@ #: List all locally installable formulae including short names. #: -# shellcheck disable=SC2155 homebrew-formulae() { - local formulae="$(\find "$HOMEBREW_REPOSITORY"/Library/Taps -type d \( -name Casks -o -name cmd -o -name .github \) -prune -false -o -name '*rb' | \sed -E -e 's/\.rb//g' -e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' -e 's|/Formula/|/|')" - local shortnames="$(echo "$formulae" | \cut -d / -f 3)" + local formulae + formulae="$(\find "$HOMEBREW_REPOSITORY"/Library/Taps -type d \( -name Casks -o -name cmd -o -name .github \) -prune -false -o -name '*rb' |\ + \sed -E -e 's/\.rb//g' -e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' -e 's|/Formula/|/|')" + local shortnames + shortnames="$(echo "$formulae" | \cut -d / -f 3)" echo -e "$formulae \n $shortnames" | \grep -v '^homebrew/' | \sort -uf } From e428ca55bedf37d5a0d02ccbf48beae7312eb6cf Mon Sep 17 00:00:00 2001 From: metacollin Date: Thu, 19 Nov 2020 20:43:09 -0700 Subject: [PATCH 06/15] Removed escape \ in front of commands --- Library/Homebrew/cmd/formulae.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cmd/formulae.sh b/Library/Homebrew/cmd/formulae.sh index f543def388..3cf596aa93 100644 --- a/Library/Homebrew/cmd/formulae.sh +++ b/Library/Homebrew/cmd/formulae.sh @@ -5,9 +5,9 @@ homebrew-formulae() { local formulae - formulae="$(\find "$HOMEBREW_REPOSITORY"/Library/Taps -type d \( -name Casks -o -name cmd -o -name .github \) -prune -false -o -name '*rb' |\ - \sed -E -e 's/\.rb//g' -e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' -e 's|/Formula/|/|')" + formulae="$(find "$HOMEBREW_REPOSITORY"/Library/Taps -type d \( -name Casks -o -name cmd -o -name .github \) -prune -false -o -name '*rb' |\ + sed -E -e 's/\.rb//g' -e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' -e 's|/Formula/|/|')" local shortnames - shortnames="$(echo "$formulae" | \cut -d / -f 3)" - echo -e "$formulae \n $shortnames" | \grep -v '^homebrew/' | \sort -uf + shortnames="$(echo "$formulae" | cut -d / -f 3)" + echo -e "$formulae \n $shortnames" | grep -v '^homebrew/' | sort -uf } From 7b67c000b021e1601ed12d2eb944d0789376cbf8 Mon Sep 17 00:00:00 2001 From: metacollin Date: Thu, 19 Nov 2020 20:50:34 -0700 Subject: [PATCH 07/15] Fix docs --- Library/Homebrew/cmd/formulae.sh | 2 +- docs/Manpage.md | 52 +++++++++++++----------------- manpages/brew.1 | 55 +++++++++++++++++--------------- 3 files changed, 53 insertions(+), 56 deletions(-) diff --git a/Library/Homebrew/cmd/formulae.sh b/Library/Homebrew/cmd/formulae.sh index 3cf596aa93..bdb6fc52c2 100644 --- a/Library/Homebrew/cmd/formulae.sh +++ b/Library/Homebrew/cmd/formulae.sh @@ -1,4 +1,4 @@ -#: * `formulae` [] +#: * `formulae` #: #: List all locally installable formulae including short names. #: diff --git a/docs/Manpage.md b/docs/Manpage.md index c78ef52bd4..b48b6c108d 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -221,10 +221,6 @@ For tarballs, also print SHA-256 checksums. * `--force-bottle`: Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation. -### `formulae` - -List all locally installable formulae including short names. - ### `gist-logs` [*`options`*] *`formula`* Upload logs for a failed build of *`formula`* to a new Gist. Presents an @@ -1425,14 +1421,12 @@ Bundler for non-Ruby dependencies from Homebrew, Homebrew Cask, Mac App Store an `brew bundle` [`install`]
Install and upgrade (by default) all dependencies from the `Brewfile`. -You can specify the `Brewfile` location using `--file` or by setting the `HOMEBREW_BUNDLE_FILE` environment variable. - -You can skip the installation of dependencies by adding space-separated values to one or more of the following environment variables: `HOMEBREW_BUNDLE_BREW_SKIP`, `HOMEBREW_BUNDLE_CASK_SKIP`, `HOMEBREW_BUNDLE_MAS_SKIP`, `HOMEBREW_BUNDLE_WHALEBREW_SKIP`, `HOMEBREW_BUNDLE_TAP_SKIP`. +You can skip the installation of dependencies by adding space-separated values to one or more of the following environment variables: `HOMEBREW_BUNDLE_BREW_SKIP`, `HOMEBREW_BUNDLE_CASK_SKIP`, `HOMEBREW_BUNDLE_MAS_SKIP`, `HOMEBREW_BUNDLE_WHALEBREW_SKIP`, `HOMEBREW_BUNDLE_TAP_SKIP` `brew bundle` will output a `Brewfile.lock.json` in the same directory as the `Brewfile` if all dependencies are installed successfully. This contains dependency and system status information which can be useful in debugging `brew bundle` failures and replicating a "last known good build" state. You can opt-out of this behaviour by setting the `HOMEBREW_BUNDLE_NO_LOCK` environment variable or passing the `--no-lock` option. You may wish to check this file into the same version control system as your `Brewfile` (or ensure your version control system ignores it if you'd prefer to rely on debugging information from a local machine). `brew bundle dump` -
Write all installed casks/formulae/images/taps into a `Brewfile` in the current directory. +
Write all installed casks/formulae/images/taps into a `Brewfile`. `brew bundle cleanup`
Uninstall all dependencies not listed from the `Brewfile`. @@ -1440,12 +1434,12 @@ You can skip the installation of dependencies by adding space-separated values t This workflow is useful for maintainers or testers who regularly install lots of formulae. `brew bundle check` -
Check if all dependencies are installed from the `Brewfile`. +
Check if all dependencies are installed from the `Brewfile` . This provides a successful exit code if everything is up-to-date, making it useful for scripting. `brew bundle list` -
List all dependencies present in the `Brewfile`. +
List all dependencies present in a `Brewfile`. By default, only Homebrew dependencies are listed. @@ -1515,46 +1509,46 @@ Otherwise, operate on `~/Library/LaunchAgents` (started at login). * `--all`: Run *`subcommand`* on all services. -### `test-bot` [*`options`*] [*`formula`*] +### `test-bot` [*`options`*] [*`formula`*]: -Tests the full lifecycle of a Homebrew change to a tap (Git repository). For example, for a GitHub Actions pull request that changes a formula `brew test-bot` will ensure the system is cleaned and set up to test the formula, install the formula, run various tests and checks on it, bottle (package) the binaries and test formulae that depend on it to ensure they aren't broken by these changes. +Tests the full lifecycle of a Homebrew change to a tap (Git repository). For example, for a GitHub Actions pull request that changes a formula `brew test-bot` will ensure the system is cleaned and setup to test the formula, install the formula, run various tests and checks on it, bottle (package) the binaries and test formulae that depend on it to ensure they aren't broken by these changes. Only supports GitHub Actions as a CI provider. This is because Homebrew uses GitHub Actions and it's freely available for public and private use with macOS and Linux workers. * `--dry-run`: - Print what would be done rather than doing it. + print what would be done rather than doing it. * `--cleanup`: - Clean all state from the Homebrew directory. Use with care! + clean all state from the Homebrew directory. Use with care! * `--skip-setup`: - Don't check if the local system is set up correctly. + don't check if the local system is set up correctly. * `--keep-old`: - Run `brew bottle --keep-old` to build new bottles for a single platform. + run `brew bottle --keep-old` to build new bottles for a single platform. * `--skip-relocation`: - Run `brew bottle --skip-relocation` to build new bottles that don't require relocation. + run `brew bottle --skip-relocation` to build new bottles that don't require relocation. * `--local`: - Ask Homebrew to write verbose logs under `./logs/` and set `$HOME` to `./home/` + ask Homebrew to write verbose logs under `./logs/` and set `$HOME` to `./home/` * `--tap`: - Use the Git repository of the given tap. Defaults to the core tap for syntax checking. + use the `git` repository of the given tap. Defaults to the core tap for syntax checking. * `--fail-fast`: - Immediately exit on a failing step. + immediately exit on a failing step. * `-v`, `--verbose`: - Print test step output in real time. Has the side effect of passing output as raw bytes instead of re-encoding in UTF-8. + print test step output in real time. Has the side effect of passing output as raw bytes instead of re-encoding in UTF-8. * `--test-default-formula`: - Use a default testing formula when not building a tap and no other formulae are specified. + use a default testing formula when not building a tap and no other formulae are specified. * `--bintray-org`: - Upload bottles to the given Bintray organisation. + upload to the given Bintray organisation. * `--root-url`: - Use the specified *`URL`* as the root of the bottle's URL instead of Homebrew's default. + use the specified *`URL`* as the root of the bottle's URL instead of Homebrew's default. * `--git-name`: - Set the Git author/committer names to the given name. + set the Git author/committer names to the given name. * `--git-email`: - Set the Git author/committer email to the given email. + set the Git author/committer email to the given email. * `--ci-upload`: - Use the Homebrew CI bottle upload options. + use the Homebrew CI bottle upload options. * `--publish`: - Publish the uploaded bottles. + publish the uploaded bottles. * `--skip-recursive-dependents`: - Only test the direct dependents. + only test the direct dependents. * `--only-cleanup-before`: Only run the pre-cleanup step. Needs `--cleanup`. * `--only-setup`: diff --git a/manpages/brew.1 b/manpages/brew.1 index c9f6356510..a25e2c8474 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -293,8 +293,14 @@ Download source packages (for eventual bottling) rather than a bottle\. Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation\. . .SS "\fBformulae\fR" +List all locally installable formulae including short names\. +. +.SS "\fBformulae\fR" Prints a sorted list of locally available formulas including shortnames\. . +.SS "\fBformulae\fR [\fIoptions\fR]" +List all locally installable formulae including short names\. +. .SS "\fBgist\-logs\fR [\fIoptions\fR] \fIformula\fR" Upload logs for a failed build of \fIformula\fR to a new Gist\. Presents an error message if no logs are found\. . @@ -1958,17 +1964,14 @@ Bundler for non\-Ruby dependencies from Homebrew, Homebrew Cask, Mac App Store a Install and upgrade (by default) all dependencies from the \fBBrewfile\fR\. . .P -You can specify the \fBBrewfile\fR location using \fB\-\-file\fR or by setting the \fBHOMEBREW_BUNDLE_FILE\fR environment variable\. -. -.P -You can skip the installation of dependencies by adding space\-separated values to one or more of the following environment variables: \fBHOMEBREW_BUNDLE_BREW_SKIP\fR, \fBHOMEBREW_BUNDLE_CASK_SKIP\fR, \fBHOMEBREW_BUNDLE_MAS_SKIP\fR, \fBHOMEBREW_BUNDLE_WHALEBREW_SKIP\fR, \fBHOMEBREW_BUNDLE_TAP_SKIP\fR\. +You can skip the installation of dependencies by adding space\-separated values to one or more of the following environment variables: \fBHOMEBREW_BUNDLE_BREW_SKIP\fR, \fBHOMEBREW_BUNDLE_CASK_SKIP\fR, \fBHOMEBREW_BUNDLE_MAS_SKIP\fR, \fBHOMEBREW_BUNDLE_WHALEBREW_SKIP\fR, \fBHOMEBREW_BUNDLE_TAP_SKIP\fR . .P \fBbrew bundle\fR will output a \fBBrewfile\.lock\.json\fR in the same directory as the \fBBrewfile\fR if all dependencies are installed successfully\. This contains dependency and system status information which can be useful in debugging \fBbrew bundle\fR failures and replicating a "last known good build" state\. You can opt\-out of this behaviour by setting the \fBHOMEBREW_BUNDLE_NO_LOCK\fR environment variable or passing the \fB\-\-no\-lock\fR option\. You may wish to check this file into the same version control system as your \fBBrewfile\fR (or ensure your version control system ignores it if you\'d prefer to rely on debugging information from a local machine)\. . .P \fBbrew bundle dump\fR - Write all installed casks/formulae/images/taps into a \fBBrewfile\fR in the current directory\. + Write all installed casks/formulae/images/taps into a \fBBrewfile\fR\. . .P \fBbrew bundle cleanup\fR @@ -1979,14 +1982,14 @@ This workflow is useful for maintainers or testers who regularly install lots of . .P \fBbrew bundle check\fR - Check if all dependencies are installed from the \fBBrewfile\fR\. + Check if all dependencies are installed from the \fBBrewfile\fR \. . .P This provides a successful exit code if everything is up\-to\-date, making it useful for scripting\. . .P \fBbrew bundle list\fR - List all dependencies present in the \fBBrewfile\fR\. + List all dependencies present in a \fBBrewfile\fR\. . .P By default, only Homebrew dependencies are listed\. @@ -2096,79 +2099,79 @@ If \fBsudo\fR is passed, operate on \fB/Library/LaunchDaemons\fR (started at boo \fB\-\-all\fR Run \fIsubcommand\fR on all services\. . -.SS "\fBtest\-bot\fR [\fIoptions\fR] [\fIformula\fR]" -Tests the full lifecycle of a Homebrew change to a tap (Git repository)\. For example, for a GitHub Actions pull request that changes a formula \fBbrew test\-bot\fR will ensure the system is cleaned and set up to test the formula, install the formula, run various tests and checks on it, bottle (package) the binaries and test formulae that depend on it to ensure they aren\'t broken by these changes\. +.SS "\fBtest\-bot\fR [\fIoptions\fR] [\fIformula\fR]:" +Tests the full lifecycle of a Homebrew change to a tap (Git repository)\. For example, for a GitHub Actions pull request that changes a formula \fBbrew test\-bot\fR will ensure the system is cleaned and setup to test the formula, install the formula, run various tests and checks on it, bottle (package) the binaries and test formulae that depend on it to ensure they aren\'t broken by these changes\. . .P Only supports GitHub Actions as a CI provider\. This is because Homebrew uses GitHub Actions and it\'s freely available for public and private use with macOS and Linux workers\. . .TP \fB\-\-dry\-run\fR -Print what would be done rather than doing it\. +print what would be done rather than doing it\. . .TP \fB\-\-cleanup\fR -Clean all state from the Homebrew directory\. Use with care! +clean all state from the Homebrew directory\. Use with care! . .TP \fB\-\-skip\-setup\fR -Don\'t check if the local system is set up correctly\. +don\'t check if the local system is set up correctly\. . .TP \fB\-\-keep\-old\fR -Run \fBbrew bottle \-\-keep\-old\fR to build new bottles for a single platform\. +run \fBbrew bottle \-\-keep\-old\fR to build new bottles for a single platform\. . .TP \fB\-\-skip\-relocation\fR -Run \fBbrew bottle \-\-skip\-relocation\fR to build new bottles that don\'t require relocation\. +run \fBbrew bottle \-\-skip\-relocation\fR to build new bottles that don\'t require relocation\. . .TP \fB\-\-local\fR -Ask Homebrew to write verbose logs under \fB\./logs/\fR and set \fB$HOME\fR to \fB\./home/\fR +ask Homebrew to write verbose logs under \fB\./logs/\fR and set \fB$HOME\fR to \fB\./home/\fR . .TP \fB\-\-tap\fR -Use the Git repository of the given tap\. Defaults to the core tap for syntax checking\. +use the \fBgit\fR repository of the given tap\. Defaults to the core tap for syntax checking\. . .TP \fB\-\-fail\-fast\fR -Immediately exit on a failing step\. +immediately exit on a failing step\. . .TP \fB\-v\fR, \fB\-\-verbose\fR -Print test step output in real time\. Has the side effect of passing output as raw bytes instead of re\-encoding in UTF\-8\. +print test step output in real time\. Has the side effect of passing output as raw bytes instead of re\-encoding in UTF\-8\. . .TP \fB\-\-test\-default\-formula\fR -Use a default testing formula when not building a tap and no other formulae are specified\. +use a default testing formula when not building a tap and no other formulae are specified\. . .TP \fB\-\-bintray\-org\fR -Upload bottles to the given Bintray organisation\. +upload to the given Bintray organisation\. . .TP \fB\-\-root\-url\fR -Use the specified \fIURL\fR as the root of the bottle\'s URL instead of Homebrew\'s default\. +use the specified \fIURL\fR as the root of the bottle\'s URL instead of Homebrew\'s default\. . .TP \fB\-\-git\-name\fR -Set the Git author/committer names to the given name\. +set the Git author/committer names to the given name\. . .TP \fB\-\-git\-email\fR -Set the Git author/committer email to the given email\. +set the Git author/committer email to the given email\. . .TP \fB\-\-ci\-upload\fR -Use the Homebrew CI bottle upload options\. +use the Homebrew CI bottle upload options\. . .TP \fB\-\-publish\fR -Publish the uploaded bottles\. +publish the uploaded bottles\. . .TP \fB\-\-skip\-recursive\-dependents\fR -Only test the direct dependents\. +only test the direct dependents\. . .TP \fB\-\-only\-cleanup\-before\fR From 7c6da6a043940ebca9b0a9823204376ce1262848 Mon Sep 17 00:00:00 2001 From: metacollin Date: Thu, 19 Nov 2020 20:52:35 -0700 Subject: [PATCH 08/15] Fix docs --- docs/Manpage.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/Manpage.md b/docs/Manpage.md index b48b6c108d..abac7b1f37 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -221,6 +221,10 @@ For tarballs, also print SHA-256 checksums. * `--force-bottle`: Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation. +### `formulae` + +List all locally installable formulae including short names. + ### `gist-logs` [*`options`*] *`formula`* Upload logs for a failed build of *`formula`* to a new Gist. Presents an From 847766140fcd1bb66d0472cb799c1732721ad700 Mon Sep 17 00:00:00 2001 From: metacollin Date: Thu, 19 Nov 2020 20:56:20 -0700 Subject: [PATCH 09/15] Doc problems --- completions/internal_commands_list.txt | 1 - docs/Manpage.md | 52 +++++++++++++------------- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/completions/internal_commands_list.txt b/completions/internal_commands_list.txt index 9c91e9f1f3..0d277a1200 100644 --- a/completions/internal_commands_list.txt +++ b/completions/internal_commands_list.txt @@ -37,7 +37,6 @@ environment extract fetch formula -formulae gist-logs help home diff --git a/docs/Manpage.md b/docs/Manpage.md index abac7b1f37..9f5b14a52a 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -221,10 +221,6 @@ For tarballs, also print SHA-256 checksums. * `--force-bottle`: Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation. -### `formulae` - -List all locally installable formulae including short names. - ### `gist-logs` [*`options`*] *`formula`* Upload logs for a failed build of *`formula`* to a new Gist. Presents an @@ -1425,12 +1421,14 @@ Bundler for non-Ruby dependencies from Homebrew, Homebrew Cask, Mac App Store an `brew bundle` [`install`]
Install and upgrade (by default) all dependencies from the `Brewfile`. -You can skip the installation of dependencies by adding space-separated values to one or more of the following environment variables: `HOMEBREW_BUNDLE_BREW_SKIP`, `HOMEBREW_BUNDLE_CASK_SKIP`, `HOMEBREW_BUNDLE_MAS_SKIP`, `HOMEBREW_BUNDLE_WHALEBREW_SKIP`, `HOMEBREW_BUNDLE_TAP_SKIP` +You can specify the `Brewfile` location using `--file` or by setting the `HOMEBREW_BUNDLE_FILE` environment variable. + +You can skip the installation of dependencies by adding space-separated values to one or more of the following environment variables: `HOMEBREW_BUNDLE_BREW_SKIP`, `HOMEBREW_BUNDLE_CASK_SKIP`, `HOMEBREW_BUNDLE_MAS_SKIP`, `HOMEBREW_BUNDLE_WHALEBREW_SKIP`, `HOMEBREW_BUNDLE_TAP_SKIP`. `brew bundle` will output a `Brewfile.lock.json` in the same directory as the `Brewfile` if all dependencies are installed successfully. This contains dependency and system status information which can be useful in debugging `brew bundle` failures and replicating a "last known good build" state. You can opt-out of this behaviour by setting the `HOMEBREW_BUNDLE_NO_LOCK` environment variable or passing the `--no-lock` option. You may wish to check this file into the same version control system as your `Brewfile` (or ensure your version control system ignores it if you'd prefer to rely on debugging information from a local machine). `brew bundle dump` -
Write all installed casks/formulae/images/taps into a `Brewfile`. +
Write all installed casks/formulae/images/taps into a `Brewfile` in the current directory. `brew bundle cleanup`
Uninstall all dependencies not listed from the `Brewfile`. @@ -1438,12 +1436,12 @@ You can skip the installation of dependencies by adding space-separated values t This workflow is useful for maintainers or testers who regularly install lots of formulae. `brew bundle check` -
Check if all dependencies are installed from the `Brewfile` . +
Check if all dependencies are installed from the `Brewfile`. This provides a successful exit code if everything is up-to-date, making it useful for scripting. `brew bundle list` -
List all dependencies present in a `Brewfile`. +
List all dependencies present in the `Brewfile`. By default, only Homebrew dependencies are listed. @@ -1513,46 +1511,46 @@ Otherwise, operate on `~/Library/LaunchAgents` (started at login). * `--all`: Run *`subcommand`* on all services. -### `test-bot` [*`options`*] [*`formula`*]: +### `test-bot` [*`options`*] [*`formula`*] -Tests the full lifecycle of a Homebrew change to a tap (Git repository). For example, for a GitHub Actions pull request that changes a formula `brew test-bot` will ensure the system is cleaned and setup to test the formula, install the formula, run various tests and checks on it, bottle (package) the binaries and test formulae that depend on it to ensure they aren't broken by these changes. +Tests the full lifecycle of a Homebrew change to a tap (Git repository). For example, for a GitHub Actions pull request that changes a formula `brew test-bot` will ensure the system is cleaned and set up to test the formula, install the formula, run various tests and checks on it, bottle (package) the binaries and test formulae that depend on it to ensure they aren't broken by these changes. Only supports GitHub Actions as a CI provider. This is because Homebrew uses GitHub Actions and it's freely available for public and private use with macOS and Linux workers. * `--dry-run`: - print what would be done rather than doing it. + Print what would be done rather than doing it. * `--cleanup`: - clean all state from the Homebrew directory. Use with care! + Clean all state from the Homebrew directory. Use with care! * `--skip-setup`: - don't check if the local system is set up correctly. + Don't check if the local system is set up correctly. * `--keep-old`: - run `brew bottle --keep-old` to build new bottles for a single platform. + Run `brew bottle --keep-old` to build new bottles for a single platform. * `--skip-relocation`: - run `brew bottle --skip-relocation` to build new bottles that don't require relocation. + Run `brew bottle --skip-relocation` to build new bottles that don't require relocation. * `--local`: - ask Homebrew to write verbose logs under `./logs/` and set `$HOME` to `./home/` + Ask Homebrew to write verbose logs under `./logs/` and set `$HOME` to `./home/` * `--tap`: - use the `git` repository of the given tap. Defaults to the core tap for syntax checking. + Use the Git repository of the given tap. Defaults to the core tap for syntax checking. * `--fail-fast`: - immediately exit on a failing step. + Immediately exit on a failing step. * `-v`, `--verbose`: - print test step output in real time. Has the side effect of passing output as raw bytes instead of re-encoding in UTF-8. + Print test step output in real time. Has the side effect of passing output as raw bytes instead of re-encoding in UTF-8. * `--test-default-formula`: - use a default testing formula when not building a tap and no other formulae are specified. + Use a default testing formula when not building a tap and no other formulae are specified. * `--bintray-org`: - upload to the given Bintray organisation. + Upload bottles to the given Bintray organisation. * `--root-url`: - use the specified *`URL`* as the root of the bottle's URL instead of Homebrew's default. + Use the specified *`URL`* as the root of the bottle's URL instead of Homebrew's default. * `--git-name`: - set the Git author/committer names to the given name. + Set the Git author/committer names to the given name. * `--git-email`: - set the Git author/committer email to the given email. + Set the Git author/committer email to the given email. * `--ci-upload`: - use the Homebrew CI bottle upload options. + Use the Homebrew CI bottle upload options. * `--publish`: - publish the uploaded bottles. + Publish the uploaded bottles. * `--skip-recursive-dependents`: - only test the direct dependents. + Only test the direct dependents. * `--only-cleanup-before`: Only run the pre-cleanup step. Needs `--cleanup`. * `--only-setup`: From de0aae8ed16c59e713fcd80c92270c104bfee97a Mon Sep 17 00:00:00 2001 From: metacollin Date: Thu, 19 Nov 2020 20:59:54 -0700 Subject: [PATCH 10/15] Man problems --- manpages/brew.1 | 58 ++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/manpages/brew.1 b/manpages/brew.1 index a25e2c8474..d0902e08cb 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -292,15 +292,6 @@ Download source packages (for eventual bottling) rather than a bottle\. \fB\-\-force\-bottle\fR Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation\. . -.SS "\fBformulae\fR" -List all locally installable formulae including short names\. -. -.SS "\fBformulae\fR" -Prints a sorted list of locally available formulas including shortnames\. -. -.SS "\fBformulae\fR [\fIoptions\fR]" -List all locally installable formulae including short names\. -. .SS "\fBgist\-logs\fR [\fIoptions\fR] \fIformula\fR" Upload logs for a failed build of \fIformula\fR to a new Gist\. Presents an error message if no logs are found\. . @@ -1964,14 +1955,17 @@ Bundler for non\-Ruby dependencies from Homebrew, Homebrew Cask, Mac App Store a Install and upgrade (by default) all dependencies from the \fBBrewfile\fR\. . .P -You can skip the installation of dependencies by adding space\-separated values to one or more of the following environment variables: \fBHOMEBREW_BUNDLE_BREW_SKIP\fR, \fBHOMEBREW_BUNDLE_CASK_SKIP\fR, \fBHOMEBREW_BUNDLE_MAS_SKIP\fR, \fBHOMEBREW_BUNDLE_WHALEBREW_SKIP\fR, \fBHOMEBREW_BUNDLE_TAP_SKIP\fR +You can specify the \fBBrewfile\fR location using \fB\-\-file\fR or by setting the \fBHOMEBREW_BUNDLE_FILE\fR environment variable\. +. +.P +You can skip the installation of dependencies by adding space\-separated values to one or more of the following environment variables: \fBHOMEBREW_BUNDLE_BREW_SKIP\fR, \fBHOMEBREW_BUNDLE_CASK_SKIP\fR, \fBHOMEBREW_BUNDLE_MAS_SKIP\fR, \fBHOMEBREW_BUNDLE_WHALEBREW_SKIP\fR, \fBHOMEBREW_BUNDLE_TAP_SKIP\fR\. . .P \fBbrew bundle\fR will output a \fBBrewfile\.lock\.json\fR in the same directory as the \fBBrewfile\fR if all dependencies are installed successfully\. This contains dependency and system status information which can be useful in debugging \fBbrew bundle\fR failures and replicating a "last known good build" state\. You can opt\-out of this behaviour by setting the \fBHOMEBREW_BUNDLE_NO_LOCK\fR environment variable or passing the \fB\-\-no\-lock\fR option\. You may wish to check this file into the same version control system as your \fBBrewfile\fR (or ensure your version control system ignores it if you\'d prefer to rely on debugging information from a local machine)\. . .P \fBbrew bundle dump\fR - Write all installed casks/formulae/images/taps into a \fBBrewfile\fR\. + Write all installed casks/formulae/images/taps into a \fBBrewfile\fR in the current directory\. . .P \fBbrew bundle cleanup\fR @@ -1982,14 +1976,14 @@ This workflow is useful for maintainers or testers who regularly install lots of . .P \fBbrew bundle check\fR - Check if all dependencies are installed from the \fBBrewfile\fR \. + Check if all dependencies are installed from the \fBBrewfile\fR\. . .P This provides a successful exit code if everything is up\-to\-date, making it useful for scripting\. . .P \fBbrew bundle list\fR - List all dependencies present in a \fBBrewfile\fR\. + List all dependencies present in the \fBBrewfile\fR\. . .P By default, only Homebrew dependencies are listed\. @@ -2099,79 +2093,79 @@ If \fBsudo\fR is passed, operate on \fB/Library/LaunchDaemons\fR (started at boo \fB\-\-all\fR Run \fIsubcommand\fR on all services\. . -.SS "\fBtest\-bot\fR [\fIoptions\fR] [\fIformula\fR]:" -Tests the full lifecycle of a Homebrew change to a tap (Git repository)\. For example, for a GitHub Actions pull request that changes a formula \fBbrew test\-bot\fR will ensure the system is cleaned and setup to test the formula, install the formula, run various tests and checks on it, bottle (package) the binaries and test formulae that depend on it to ensure they aren\'t broken by these changes\. +.SS "\fBtest\-bot\fR [\fIoptions\fR] [\fIformula\fR]" +Tests the full lifecycle of a Homebrew change to a tap (Git repository)\. For example, for a GitHub Actions pull request that changes a formula \fBbrew test\-bot\fR will ensure the system is cleaned and set up to test the formula, install the formula, run various tests and checks on it, bottle (package) the binaries and test formulae that depend on it to ensure they aren\'t broken by these changes\. . .P Only supports GitHub Actions as a CI provider\. This is because Homebrew uses GitHub Actions and it\'s freely available for public and private use with macOS and Linux workers\. . .TP \fB\-\-dry\-run\fR -print what would be done rather than doing it\. +Print what would be done rather than doing it\. . .TP \fB\-\-cleanup\fR -clean all state from the Homebrew directory\. Use with care! +Clean all state from the Homebrew directory\. Use with care! . .TP \fB\-\-skip\-setup\fR -don\'t check if the local system is set up correctly\. +Don\'t check if the local system is set up correctly\. . .TP \fB\-\-keep\-old\fR -run \fBbrew bottle \-\-keep\-old\fR to build new bottles for a single platform\. +Run \fBbrew bottle \-\-keep\-old\fR to build new bottles for a single platform\. . .TP \fB\-\-skip\-relocation\fR -run \fBbrew bottle \-\-skip\-relocation\fR to build new bottles that don\'t require relocation\. +Run \fBbrew bottle \-\-skip\-relocation\fR to build new bottles that don\'t require relocation\. . .TP \fB\-\-local\fR -ask Homebrew to write verbose logs under \fB\./logs/\fR and set \fB$HOME\fR to \fB\./home/\fR +Ask Homebrew to write verbose logs under \fB\./logs/\fR and set \fB$HOME\fR to \fB\./home/\fR . .TP \fB\-\-tap\fR -use the \fBgit\fR repository of the given tap\. Defaults to the core tap for syntax checking\. +Use the Git repository of the given tap\. Defaults to the core tap for syntax checking\. . .TP \fB\-\-fail\-fast\fR -immediately exit on a failing step\. +Immediately exit on a failing step\. . .TP \fB\-v\fR, \fB\-\-verbose\fR -print test step output in real time\. Has the side effect of passing output as raw bytes instead of re\-encoding in UTF\-8\. +Print test step output in real time\. Has the side effect of passing output as raw bytes instead of re\-encoding in UTF\-8\. . .TP \fB\-\-test\-default\-formula\fR -use a default testing formula when not building a tap and no other formulae are specified\. +Use a default testing formula when not building a tap and no other formulae are specified\. . .TP \fB\-\-bintray\-org\fR -upload to the given Bintray organisation\. +Upload bottles to the given Bintray organisation\. . .TP \fB\-\-root\-url\fR -use the specified \fIURL\fR as the root of the bottle\'s URL instead of Homebrew\'s default\. +Use the specified \fIURL\fR as the root of the bottle\'s URL instead of Homebrew\'s default\. . .TP \fB\-\-git\-name\fR -set the Git author/committer names to the given name\. +Set the Git author/committer names to the given name\. . .TP \fB\-\-git\-email\fR -set the Git author/committer email to the given email\. +Set the Git author/committer email to the given email\. . .TP \fB\-\-ci\-upload\fR -use the Homebrew CI bottle upload options\. +Use the Homebrew CI bottle upload options\. . .TP \fB\-\-publish\fR -publish the uploaded bottles\. +Publish the uploaded bottles\. . .TP \fB\-\-skip\-recursive\-dependents\fR -only test the direct dependents\. +Only test the direct dependents\. . .TP \fB\-\-only\-cleanup\-before\fR From 3fdad5ed3355ddc16c95b2633da9f63cb0247a3d Mon Sep 17 00:00:00 2001 From: metacollin Date: Thu, 19 Nov 2020 21:00:10 -0700 Subject: [PATCH 11/15] Fixed tabs instead of spaces --- completions/zsh/_brew | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/zsh/_brew b/completions/zsh/_brew index 9dbb17e38c..3e81da5624 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -111,7 +111,7 @@ __brew_common_commands() { 'edit:edit a formula' 'fetch:download formula resources to the cache' 'formula:the path for a formula' - 'formulae:show a sorted list of installable formulae' + 'formulae:show a sorted list of installable formulae' 'gist-logs:generate a gist of the full build logs' 'home:visit the homepage of a formula or the brew project' 'info:information about a formula' From 2832048692bb865717d403fd35b5d1eab39bb09e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 20 Nov 2020 12:34:21 +0000 Subject: [PATCH 12/15] brew.sh: cleanup indentation. --- Library/Homebrew/brew.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 966e048f04..096e74b13c 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -38,13 +38,13 @@ HOMEBREW_TEMP="${HOMEBREW_TEMP:-${HOMEBREW_DEFAULT_TEMP}}" # Don't need shellcheck to follow these `source`. # shellcheck disable=SC1090 case "$*" in - --prefix) echo "$HOMEBREW_PREFIX"; exit 0 ;; - --cellar) echo "$HOMEBREW_CELLAR"; exit 0 ;; - --repository|--repo) echo "$HOMEBREW_REPOSITORY"; exit 0 ;; - --caskroom) echo "$HOMEBREW_PREFIX/Caskroom"; exit 0 ;; - --cache) echo "$HOMEBREW_CACHE"; exit 0 ;; - shellenv) source "$HOMEBREW_LIBRARY/Homebrew/cmd/shellenv.sh"; homebrew-shellenv; exit 0 ;; - formulae) source "$HOMEBREW_LIBRARY/Homebrew/cmd/formulae.sh"; homebrew-formulae; exit 0 ;; + --prefix) echo "$HOMEBREW_PREFIX"; exit 0 ;; + --cellar) echo "$HOMEBREW_CELLAR"; exit 0 ;; + --repository|--repo) echo "$HOMEBREW_REPOSITORY"; exit 0 ;; + --caskroom) echo "$HOMEBREW_PREFIX/Caskroom"; exit 0 ;; + --cache) echo "$HOMEBREW_CACHE"; exit 0 ;; + shellenv) source "$HOMEBREW_LIBRARY/Homebrew/cmd/shellenv.sh"; homebrew-shellenv; exit 0 ;; + formulae) source "$HOMEBREW_LIBRARY/Homebrew/cmd/formulae.sh"; homebrew-formulae; exit 0 ;; esac ##### From 2a2971504273d2ab9e42d17ab77bf30e7f04acba Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 20 Nov 2020 12:43:38 +0000 Subject: [PATCH 13/15] cmd/formulae.sh: improve and refactor. --- Library/Homebrew/cmd/formulae.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cmd/formulae.sh b/Library/Homebrew/cmd/formulae.sh index bdb6fc52c2..e4eab99abd 100644 --- a/Library/Homebrew/cmd/formulae.sh +++ b/Library/Homebrew/cmd/formulae.sh @@ -5,9 +5,24 @@ homebrew-formulae() { local formulae - formulae="$(find "$HOMEBREW_REPOSITORY"/Library/Taps -type d \( -name Casks -o -name cmd -o -name .github \) -prune -false -o -name '*rb' |\ - sed -E -e 's/\.rb//g' -e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' -e 's|/Formula/|/|')" + formulae="$( \ + find "$HOMEBREW_REPOSITORY/Library/Taps" \ + -type d \( \ + -name Casks -o \ + -name cmd -o \ + -name .github -o \ + -name lib -o \ + -name spec -o \ + -name vendor \ + \) \ + -prune -false -o -name '*\.rb' | \ + sed -E -e 's/\.rb//g' \ + -e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' \ + -e 's|/Formula/|/|' \ + )" local shortnames - shortnames="$(echo "$formulae" | cut -d / -f 3)" - echo -e "$formulae \n $shortnames" | grep -v '^homebrew/' | sort -uf + shortnames="$(echo "$formulae" | cut -d "/" -f 3)" + echo -e "$formulae \n $shortnames" | \ + grep -v '^homebrew/core' | \ + sort -uf } From c4cc8da39ab7962fd7066f90462a3964387a9b34 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 20 Nov 2020 12:43:51 +0000 Subject: [PATCH 14/15] cmd/search.rb: add commented-out deprecation. --- Library/Homebrew/cmd/search.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 4dca6423bb..480023574c 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -78,6 +78,7 @@ module Homebrew puts Formatter.columns(Cask::Cask.to_a.map(&:full_name).sort) else + # odeprecated "'brew search' with no arguments to output formulae", "'brew formulae'" puts Formatter.columns(Formula.full_names.sort) end From 75d9d061a7927afe2d230bfbab1e9c7a92d4546e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 20 Nov 2020 12:44:07 +0000 Subject: [PATCH 15/15] Commit `brew man` output. --- completions/internal_commands_list.txt | 1 + docs/Manpage.md | 4 ++++ manpages/brew.1 | 3 +++ 3 files changed, 8 insertions(+) diff --git a/completions/internal_commands_list.txt b/completions/internal_commands_list.txt index 0d277a1200..9c91e9f1f3 100644 --- a/completions/internal_commands_list.txt +++ b/completions/internal_commands_list.txt @@ -37,6 +37,7 @@ environment extract fetch formula +formulae gist-logs help home diff --git a/docs/Manpage.md b/docs/Manpage.md index 9f5b14a52a..c78ef52bd4 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -221,6 +221,10 @@ For tarballs, also print SHA-256 checksums. * `--force-bottle`: Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation. +### `formulae` + +List all locally installable formulae including short names. + ### `gist-logs` [*`options`*] *`formula`* Upload logs for a failed build of *`formula`* to a new Gist. Presents an diff --git a/manpages/brew.1 b/manpages/brew.1 index d0902e08cb..fd918d6f37 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -292,6 +292,9 @@ Download source packages (for eventual bottling) rather than a bottle\. \fB\-\-force\-bottle\fR Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation\. . +.SS "\fBformulae\fR" +List all locally installable formulae including short names\. +. .SS "\fBgist\-logs\fR [\fIoptions\fR] \fIformula\fR" Upload logs for a failed build of \fIformula\fR to a new Gist\. Presents an error message if no logs are found\. .