This adds support for Cask old tokens used for renames of Casks.
We'll now correctly check these at installation time to avoid repeatedly
installing renamed Casks and dump them in the Brewfile. We also use this
logic to avoid cleaning up renamed Casks.
- Homebrew Bundle referred to formulae as "brews". But it referred to
casks as "casks" and taps as "taps".
- Let's use the same terminology everywhere.
- (I know that `brew "hello"` is the formula syntax in the Brewfile, so
I'm not changing that (though would be up for it, in a backwards
compatible manner), just making the code more consistent.)
- This reverts commit 68dbf12220f9a52ddf5ca5eb3aa1b356aa42da3a that was
a revert of commit 68596ec720a50f44ae9c30c5806aa7f2d4bcc96f because I
put the RBI file in the wrong place and Tapioca got rid of it, causing
this week's release to be blocked.
- move some things out of `extend` that don't really fit there e.g.
`Module`s that are included but not doing any
overriding/monkeypatching
- move some code into `extend/os` to fix all remaining
`rubocop:todo Homebrew/MoveToExtendOS`s
- remove some unneeded `bundle` skipper code that doesn't really make
sense given our current bottling strategy
- extract some `Pathname` extensions to `extend/pathname` for separate
files
- move a `ENV` `Kernel` extension into `kernel.rb`
- `odeprecate` a seemingly unused backwards compatibility method
- move `readline_nonblock` from a monkeypatch to a
`ReadlineNonblock.read` method as its only used in one place
- fix up a link in documentation
This was more painful that I expected but will allow `brew bundle sh`
and `brew sh` to use the user's configuration but use our custom prompt
for Bash and ZSH.
Let's avoid having `exec` and `env`/`sh` subcommands have different
environment variables logic. Instead, let's e.g. add `HOMEBREW_PATH`
and remove `*/Homebrew/shims/*` from the `PATH` for all three
subcommands.
This allows more consistency for users and easier to debug and reason
about behaviour.
`brew bundle exec` behaves correctly only after doing `brew bundle install`.
Running `brew bundle check` can be slow, so let's add a `--check` flag
to `brew bundle exec` which will also run `brew bundle check` before
`brew bundle exec` to ensure that the `Brewfile` has been installed
before proceeding.
- if HOMEBREW_TEMP is not writable, use the default temp directory
- when running `brew bundle exec`, strip various temporary directories
from the environment if they are not writable
- Rather than maintaining a list of Homebrew environment variables to
delete, delete all Homebrew (and Portable Ruby) internal variables
that won't be used by other tools.
- When exporting variables, only export variables that have changed.
- When exporting PATH-like variables, ensure the PATH is appending to
the existing path rather than replacing it and ensure we only include
newly added paths.
This flag allows you to specify formulae to upgrade, even if
`$HOMEBREW_BUNDLE_NO_UPGRADE` is set.
This is useful for upgrading specific formulae without upgrading all
formulae.
While we're here, let's add Sorbet signatures to the `Bundle` module
because I needed to add a new method there anyway.
Extract the relevant logic from `formula.rb`, moving to `keg.rb` and
then use this logic in `bundle/commands/cleanup.rb` to ensure that we
don't say we need to uninstall formulae that should be still kept.
If callers of `brew bundle check` have already output some formulae
errors, they can set the
`HOMEBREW_BUNDLE_CHECK_ALREADY_OUTPUT_FORMULAE_ERRORS` environment
variable to the names of the formulae that have already been output.
- Sort output by key so it's more readable.
- Skip exporting empty values because shell scripts treat them as unset.
- Skip exporting non-Homebrew things that were already set in the old
environment to avoid massive duplication and higher chances of e.g.
bad escapes breaking things.