5321 Commits

Author SHA1 Message Date
Markus Reiter
c03a351ab9
Print concurrent download errors. 2025-02-03 14:44:01 +01:00
Markus Reiter
3e8709e4da
Use full terminal height for concurrent output. 2025-02-01 17:58:54 +01:00
Ryan Rotter
ba67ccfc6e
tap command: correct helptext for --repair 2025-02-01 00:45:16 -05:00
Mike McQuaid
7ff99e2353
Use ~ instead of ${HOME}
Partial revert of Homebrew/brew#19153
See https://github.com/Homebrew/brew/pull/19153#discussion_r1930678587
2025-01-27 15:19:59 +00:00
Mike McQuaid
bbf5a9f479
env_config: use environment variables consistently
- 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.
2025-01-27 14:21:27 +00:00
Mike McQuaid
b49625a7dc
Add brew install --skip-link
We already have `--skip-post-install` and this adds similar behaviour
for e.g. `brew bundle` (and other users) to be able to install a
formula but skip the `brew link` stage afterwards.
2025-01-23 14:42:03 +00:00
Issy Long
4c9de7d31c
Merge pull request #19084 from Homebrew/add-comments-to-rubocop-disables
Add clarifying comments to `rubocop:disable`s
2025-01-13 11:32:31 +00:00
Mike McQuaid
730c93e60f
Merge pull request #19087 from Homebrew/installed_on_request_true
Fix usage of `Tab#installed_(on_request|as_dependency)`
2025-01-13 09:36:05 +00:00
Mike McQuaid
0940fb78dc
Fix usage of Tab#installed_(on_request|as_dependency)
These can return `true`, `false` or `nil` so adjust the signature to
note this and fix the call sites to ensure we don't accidentally pass
through `nil` values when we shouldn't.

While we're here, make a `TODO` to fix this bad API up in future.

Fixes https://github.com/Homebrew/brew/issues/19076
2025-01-13 09:24:42 +00:00
Adrian Ho
85c9551cd3 update.sh: reject unknown long opts
I accidentally typed `brew update --greedy` instead of `brew upgrade --greedy` and got some strange output.

This fix causes unrecognized long options to throw a usage message and exit like all the other subcommands.

Before:
```
% brew update --greedy
==> Updating Homebrew...
Usage: brew update-report [--auto-update] [--force]

The Ruby implementation of brew update. Never called manually.
[...]
```

After:
```
% brew update --greedy
Error: Unrecognized option '--greedy'
Usage: brew update, up [options]

Fetch the newest version of Homebrew and all formulae from GitHub using git(1)
and perform any necessary migrations.
[...]
```
2025-01-13 09:41:09 +08:00
Douglas Eichelberger
0add431e69 Apply manual violation fixes 2025-01-12 10:06:00 -08:00
Douglas Eichelberger
dbb731bce2 brew style --fix 2025-01-12 10:05:21 -08:00
Issy Long
6ada9a9665
Add clarifying comments to rubocop:disables
- Needed for PR 18842 that adds a `DisableComment` RuboCop to ensure that all RuboCop disables have comments.
2025-01-12 16:59:07 +00:00
Mike McQuaid
c60efd943b
cmd/uses: improve flag description. 2024-12-30 12:43:20 +00:00
Thierry Moisan
2af190363f
fixup! deps command: add --include-implicit flag 2024-12-27 13:11:04 -05:00
Thierry Moisan
d5e94f2082
deps command: add --include-implicit flag 2024-12-24 15:28:47 -05:00
Andreas Scherer
02560c9f1a Sort list of '--version'ed casks.
'brew list --cask --version' produces an unsorted list.

Also, the cask part of 'brew list --version' is unsorted, while the
formulas are (still) sorted.
2024-12-24 14:02:16 +01:00
Mike McQuaid
402c47fcc4
Merge pull request #18978 from landoncrabtree/pyenv-major-symlink
cmd/pyenv-sync: Create major version symlink(s) to fix pyenv support
2024-12-23 17:00:53 +00:00
Landon Crabtree
b6e51ee3b8 Added proper pyenv support to brew pyenv-sync by symlinking major version executables to their minor 2024-12-22 10:33:26 -06:00
Ryan Rotter
5fdb1865f9 tap command: add -f alias to --force flag 2024-12-21 22:51:47 -05:00
“Vidisha
4403280211 cmd/list: fix duplicate casks when symlinks exist
When a cask is renamed (e.g. logi-options-plus to logi-options+),
Homebrew creates a symlink in the Caskroom directory. Currently,
`brew list --cask` shows both the original and symlinked cask as
separate entries. This patch modifies the listing logic to resolve
symlinks and show only unique casks.

Fixes #18849
2024-12-16 22:20:29 -08:00
apainintheneck
8bee0555b9 cask/info: send missing args after removing openstruct
This seems like it was a bug before the recent change to remove
OpenStruct from `Homebrew::CLI::Args` but it was failing silently
before. Now we pass the args to the `Cask::Info.info` method so
that when they eventually reach the `Utils::Analytics.output_analytics`
method they are present as expected.

Example error fragment:

```console
$ set -e HOMEBREW_NO_ANALYTICS
$ brew info iterm2 --cask --verbose
==> iterm2: 3.5.10 (auto_updates)
https://iterm2.com/
Installed
/usr/local/Caskroom/iterm2/3.5.4 (91.7MB)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/i/iterm2.rb
==> Name
iTerm2
==> Description
Terminal emulator as alternative to Apple's Terminal app
==> Artifacts
iTerm.app (App)
Error: undefined method `analytics?' for an instance of Homebrew::CLI::Args
/usr/local/Homebrew/Library/Homebrew/utils/analytics.rb:248:in `output_analytics'
/usr/local/Homebrew/Library/Homebrew/utils/analytics.rb:342:in `cask_output'
/usr/local/Homebrew/Library/Homebrew/cask/info.rb:39:in `info'
```
2024-12-11 23:24:22 -08:00
Douglas Eichelberger
563c2b1d3a
Merge pull request #18847 from Homebrew/no-ostruct
Remove OpenStruct from CLI::Args
2024-12-11 18:41:13 +00:00
Ruoyu Zhong
a50e15e43c
cmd/list: support using --full-name with --installed-on-request et al.
Fixes https://github.com/Homebrew/brew/issues/18908#issuecomment-2532926860.
2024-12-11 11:27:08 +08:00
Douglas Eichelberger
3a4243742f Remove OpenStruct from CLI::Args 2024-12-08 10:27:49 -08:00
Douglas Eichelberger
ad70bcbbe0
Merge pull request #18867 from Homebrew/typed-named-args
Enable strict typing in NamedArgs
2024-12-04 08:49:46 -08:00
Douglas Eichelberger
e1fdd2eda4 Enable strict typing in NamedArgs 2024-12-03 17:43:22 -08:00
Carlo Cabrera
4029e3d7c1
cmd/update: avoid switching developers to stable branch
Checking for `HOMEBREW_NO_INSTALL_CLEANUP` was added in #18825, but this
breaks developers by switching them to the stable branch.

Setting `HOMEBREW_NO_UPDATE_CLEANUP` when `HOMEBREW_NO_INSTALL_CLEANUP`
is set seems like a relatively recent addition, so I don't think it
hurts to just remove it. We can add it back (correctly) if there are
users that need it.
2024-12-04 01:32:52 +08:00
Mike McQuaid
58e72b0a7f
Merge pull request #18856 from Homebrew/fix_brew_developer 2024-12-03 15:41:13 +00:00
Mike McQuaid
fc40424f0e
cmd/update-reset: remove .git/describe-cache.
As this is a cache and can potentially be incorrect, let's allow this
way of cleaning it up.
2024-12-03 14:30:14 +00:00
Mike McQuaid
5f82dd1880
cmd/developer: fix HOMEBREW_UPDATE_TO_TAG handling.
The handling of `HOMEBREW_UPDATE_TO_TAG` was incorrect as it implied it
also enabled developer mode whereas the opposite was true.
2024-12-03 09:08:50 +00:00
Eric Knibbe
1ed026c91a
update.sh: fix unused environment variable 2024-11-25 22:43:48 -05:00
Mike McQuaid
56780f3355
Merge pull request #18806 from Homebrew/rm-uses-ostruct
Remove OpenStruct from Uses cmd
2024-11-25 08:51:07 +00:00
Eric Knibbe
51be1d9652
revert setting --insecure to download ca-certificates 2024-11-24 14:57:32 -05:00
Douglas Eichelberger
cb1c49e06b Fix sigs 2024-11-23 10:25:45 -08:00
Douglas Eichelberger
89e640c567 Remove OpenStruct from Uses cmd 2024-11-22 21:04:51 -08:00
Mike McQuaid
4d4531c19d
Revamp installed_on_request handling
- `reinstall` and `upgrade` no longer mark as installed on request,
  with or without names specified, but preserve the version from the
  tab instead
- default `install_on_request` to `false` rather than `true`
- only set installed in request in a tab if it's missing rather than
  false

Co-authored-by: Michael Cho <michael@michaelcho.dev>
2024-11-19 08:39:55 +00:00
Douglas Eichelberger
ebe1e504da Change command output instead 2024-11-07 11:26:19 -08:00
Douglas Eichelberger
c17ffb8c3b Try matching key type 2024-11-07 09:24:50 -08:00
Mike McQuaid
e7159d733c
Revert "cmd/shellenv: set XDG_DATA_DIRS on Linux" 2024-10-30 18:27:54 -07:00
apainintheneck
200452e23d cmd/upgrade: required named args when upgrading from source
The --build-from-source flag can currently be used without specifying
a formula by name but it doesn't behave the way you'd expect it to.

It will upgrade everything using bottles if they are available and skip
building things from source. This is intentional because we want to
discourage non-developers from building packages from source since the
result is less predictable.

The change here is to error out in that case. It might be smarter to
go through the entire deprecation cycle here just in case someone
is using this in scripts.
2024-10-14 20:49:04 -07:00
Conlan Cesar
f7b8681bc9
Add zsh site-functions to fpath
I considered doing a fallthough in the case-statement, but that doesn't work on bash leq 4 (notably, those versions shipped with MacOS by default).

I chose to prepend the value to the array to mirror the homebrew completion [instructions page](https://docs.brew.sh/Shell-Completion).

I also chose to leave off the `-d`irectory check -- zsh seems to tolerate invalid paths, so there isn't much harm in adding it anyway.

I'm flexible on any of these choices should someone feel strongly. However, I imagine this is the best combination given the trade-offs we have.
2024-10-15 03:20:50 +08:00
Mike McQuaid
d1e539cb84
Merge pull request #18547 from Homebrew/cask-formula-dep-preinstall
Perform preinstall checks when a formula is installed via a cask
2024-10-13 17:40:59 +01:00
Bob Lail
a5db113d91 feat: Install an unlinked formula via brew install if --overwrite is passed
If the intention is to overwrite any existing links, then `brew install` should go on to install over an unlinked formula
2024-10-12 11:50:51 -07:00
Bo Anderson
97866f8adf
Perform preinstall checks when a formula is installed via a cask 2024-10-11 16:57:47 +01:00
Patrick Linnane
c2e2b23c50
brew style --fix
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-10-02 10:03:12 -07:00
Mike McQuaid
54d484d428
Merge pull request #18464 from benknoble/bk/tap-info-commit
feat(tap-info): display Git information about non-Core/non-API taps
2024-10-01 09:25:44 +01:00
D. Ben Knoble
3429e74d7e feat(tap-info): display Git information about non-Core/non-API taps
Copy and tweak code from Library/Homebrew/system_config.rb:110 to commit
and date information. This information can be useful when debugging
formulae in custom taps to ensure the tap has been correctly updated
recently or to suss out important differences from one version of a tap
to another.

This removes the need to ask users to run something like

    git -C $(brew --repository)/Library/Taps/<tap> show -s --decorate

Close https://github.com/Homebrew/brew/issues/18381
2024-09-30 11:27:35 -04:00
Michael Cho
4c60dc0b2c
cmd/list: -t and -r support for some long options 2024-09-26 20:01:44 -04:00
Mike McQuaid
05cde76adc
Merge pull request #18422 from Homebrew/cmd-cache-touchup
cmd/--cache: avoid exception on missing HEAD
2024-09-26 16:18:10 +01:00