I was recently running `brew tests` without `--online` and I noticed
that there was still one formulae.brew.sh request. I narrowed it down
to a `brew desc` test, so this adds `:needs_network` to that test.
As expected, `brew tests` doesn't make any network requests after this
change unless `--online` is used.
- use e.g. `$HOMEBREW_*` for cases where only the environment variable
is the entire backtick-quoted string
- use e.g. `${HOMEBREW_*}` for cases where the environment variable is
part of a backtick-quoted string to make clear what parts are variable
and what parts are not
- use `export HOMEBREW_*=...` for cases where we're talking about
setting the environment variable (because it likely needs to be
exported to work how they want)
Inspired by https://github.com/Homebrew/homebrew-bundle/pull/1579 making
similar changes for Homebrew/homebrew-bundle.
When a formula was built from source, it should not be removed by
`brew autoremove` as it will take a while to be installed again.
Fixes https://github.com/Homebrew/brew/issues/17433
Add `brew tab`, a new command to edit tab information, as previously
discussed in https://github.com/Homebrew/brew/pull/17125#issuecomment-2068473483.
Currently, this supports marking or unmarking formulae as installed on
request.
Sample usage:
$ brew tab --installed-on-request curl
==> curl is now marked as installed on request.
$ brew autoremove --dry-run
[no output]
$ brew tab --no-installed-on-request curl
==> curl is now marked as not installed on request.
$ brew autoremove --dry-run
==> Would autoremove 2 unneeded formulae:
curl
rtmpdump
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
There were a few tests which require core to be tapped and fail
if it isn't. This is annoying if someone is trying to contribute
to the project and they're using the JSON API instead of having
the core repo tapped locally.
I'm just skipping these because it's the simplest thing to do.
The tests that failed are mostly rubocop tests so it's fine
if they only run on CI.
- Add a (large) speedup by moving some logic to Bash for the typical
case of a normal or dev-cmd, Bash or Ruby command.
- Make `brew command` a non-developer command, I don't think it makes
sense to consider it something needed for developing Homebrew.
- Update the manpage/tests/RBI accordingly.
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
- It was suggested in https://github.com/Homebrew/brew/issues/ 16733 that
`brew desc <formula_or_cask>` should work like `brew info <formula_or_cask>`
and print the description of the package without needing `--eval-all`.
- Looking at the code, it seems like it's only searching that needs
`--eval-all`, so limit the check to that.
Before:
```shell
$ brew desc hello
Error: `brew desc` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!
```
After:
```shell
$ brew desc hello
hello: Program providing model for GNU coding standards and practices
$ brew desc --search hello
Error: Invalid usage: `brew desc --search` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!
$ brew desc --search --eval-all hello
==> Formulae
dsh: Dancer's shell, or distributed shell
hello: Program providing model for GNU coding standards and practices
```
The extra module was their to facilitate testing but now that
everything is properly namespaced and each command is an instance
we can just move the methods into the command. Since it's an
instance now we don't need to be as careful about caching either.