I was looking for a way to suppress output in `brew cleanup` especially the `Warning: Skipping XXX: most recent version X.Y.Z not installed`. I noticed that `Homebrew::Cleanup#clean` takes a `quiet` argument, but `brew cleanup` doesn't pass one in. This PR updates `brew cleanup` to accept and forward along a `quiet` argument.
This is useful for quickly examining bottles with something like
brew fetch --bottle-tag=$tag $formula && \
tar xf "$(brew --cache --bottle-tag=$tag $formula)"
See discussion at #15632.
Download the previously stored tap migrations files for homebrew/core
and homebrew/cask from the formulae.brew.sh API.
This adds a much longer stale time (24 hours) to decide whether or not
the migrations files need downloaded from the API in Ruby land.
`brew update` will still update them every time.
Requires https://github.com/Homebrew/brew/pull/15628
Fixes https://github.com/Homebrew/brew/issues/14897
Similar to `rbenv-sync` and `nodenv-sync`, but for use with `pyenv`.
Python has separate formulae for minor Python versions, as such this
will symlink all patch versions to the latest minor version.
Move the `names*.txt` files even when the file size hasn't changed
(which can happen when the versions change in the API but the file
size doesn't change).
Fixes#15217
While we're here, also add some whitespace for easier reading.
This screen scrapes GitHub Packages download counts from HTML for a
core formula.
It's useful when figuring out the difference between our analytics
numbers (which people can opt-out of) and our bottle downloads (which
people cannot due to the way GitHub Packages works).
These were introduced by typos and an incorrect assumption on the last
update of #15358. The last commit had been tested with a parameter, but
had not been re-tested *without* parameter.
Apologies for the error.
Resolves#15358
With this change, `brew shellenv` will accept a shell name parameter to
override its default output (based on `/bin/ps`) for advanced use cases
such as with dotfile templating and caching with
[twpayne/chezmoi](https://github.com/twpayne/chezmoi/discussions/2971).
When running under `fish`, this is the output:
```console
$ brew shellenv pwsh
[System.Environment]::SetEnvironmentVariable('HOMEBREW_PREFIX','/opt/homebrew',[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('HOMEBREW_CELLAR','/opt/homebrew/Cellar',[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('HOMEBREW_REPOSITORY','/opt/homebrew',[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('PATH',$('/opt/homebrew/bin:/opt/homebrew/sbin:'+$ENV:PATH),[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('MANPATH',$('/opt/homebrew/share/man'+$(if(${ENV:MANPATH}){':'+${ENV:MANPATH}})+':'),[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('INFOPATH',$('/opt/homebrew/share/info'+$(if(${ENV:INFOPATH}){':'+${ENV:INFOPATH}})),[System.EnvironmentVariableTarget]::Process)
$ brew shellenv
set -gx HOMEBREW_PREFIX "/opt/homebrew";
set -gx HOMEBREW_CELLAR "/opt/homebrew/Cellar";
set -gx HOMEBREW_REPOSITORY "/opt/homebrew";
set -q PATH; or set PATH ''; set -gx PATH "/opt/homebrew/bin" "/opt/homebrew/sbin" $PATH;
set -q MANPATH; or set MANPATH ''; set -gx MANPATH "/opt/homebrew/share/man" $MANPATH;
set -q INFOPATH; or set INFOPATH ''; set -gx INFOPATH "/opt/homebrew/share/info" $INFOPATH;
```
The specific case presented in the mentioned discussion could be
mitigated by an additional level of indirection (`{{ output "fish" "-c"
"'brew shellenv'" | trim }}`), that requires that the running system
have the target shells installed, when they are not strictly necessary
with `brew shellenv`.