5402 Commits

Author SHA1 Message Date
Ruoyu Zhong
c834a862ab
cmd/update-report: fix formula description display
When on a non-default branch (for e.g., testing), `Formula[formula]` can
return an error. In that case let's silently ignore it.
2025-09-13 23:27:25 +08:00
Mike McQuaid
07091cfbea
Simplify pluralisation of common words
Formulae, dependencies, tries are all used in multiple places so let's
simplify them
2025-09-12 09:02:43 +01:00
Eric Knibbe
1c4cb6936e
command options: various --eval-all fixes 2025-09-05 08:53:44 +01:00
Douglas Eichelberger
4d11307d41
Refactor T.must called on .last 2025-08-25 20:30:31 -07:00
Douglas Eichelberger
d97933b38c
Refactor T.must called on .first 2025-08-25 20:27:47 -07:00
Rylan Polster
3dff8dfb62
Create DownloadQueue helper to check concurrency and initialize 2025-08-25 13:39:35 -04:00
Branch Vincent
680596b71a
cmd/search: add --alpine 2025-08-22 20:06:23 -07:00
Mike McQuaid
5718e87e5e
cmd/upgrade: fix ofail/opoo call.
This method doesn't exist on `Kernel` any more. While we're here, let's
avoid `public_send` and use `if` instead for a bit more safety.
2025-08-22 12:54:26 +01:00
Mike McQuaid
3bbff84ff1
Merge pull request #20525 from Homebrew/utils_output
Move `o*` output methods to `Utils::Output`
2025-08-22 09:10:29 +00:00
Ruoyu Zhong
16bc592e08
settings: typed: strict 2025-08-21 14:19:34 +08:00
Mike McQuaid
a1f112f3fe
Move o* output methods to Utils::Output
This reduces the surface area of our `Kernel` monkeypatch and removes
the need to `include Kernel` in a bunch of modules.

While we're here, also move `Kernel#require?` to `Homebrew` and fully
scope the calls to it.
2025-08-20 19:20:19 +01:00
Ruoyu Zhong
c481e71092
cmd/update-report: rework 2025-08-19 14:27:05 +08:00
Ruoyu Zhong
7cec7586ff
cmd/update-report: remove unused methods 2025-08-19 02:39:26 +08:00
Ruoyu Zhong
ee515fd5e0
cmd/update-report: show new formula/cask desc for non-API users too
This will make non-API users like myself happy.
2025-08-19 02:35:44 +08:00
Eric Knibbe
468d4665fb
cmd/services: manpage fixes 2025-08-16 00:57:59 -04:00
Eric Knibbe
827480f06b
messages/comments: wording fixes 2025-08-16 00:57:59 -04:00
Eric Knibbe
e021953db4
messages/comments: formatting fixes 2025-08-16 00:54:50 -04:00
Patrick Linnane
2605529a90
brew style --fix 2025-08-13 12:23:12 -07:00
Rylan Polster
fe3aec30bb
Fetch new API 2025-08-12 17:04:15 -04:00
Rylan Polster
ff5edb73c2
Don't query analytics for third-party formulae/casks in brew info 2025-08-11 18:54:09 -04:00
Mike McQuaid
7c67b47a77
Merge pull request #20375 from Homebrew/cask_prelude_download_queue
Add `Cask::Installer#prelude` to check before download queueing
2025-08-05 14:01:09 +00:00
Mike McQuaid
3f3ddb8b9e
Merge pull request #20360 from lukarajic/cask-size
Add a flag to `brew info` to view the size of each formula and cask
2025-08-05 13:54:14 +00:00
Mike McQuaid
64311c2889
Add Cask::Installer#prelude to check before download queueing
Fixes #20374

When using HOMEBREW_DOWNLOAD_CONCURRENCY, cask binaries were being
downloaded before checking if the cask could actually be installed
(e.g., disabled casks or conflict checks). This resulted in unnecessary
downloads for casks that would ultimately fail to install.

This change adds a `prelude` method to Cask::Installer that performs
early validation checks (deprecation/disable status and conflicts)
similar to Formula#prelude_fetch. The prelude method is called before
enqueueing downloads in all download queue scenarios (install, reinstall,
and upgrade commands), ensuring that validation failures occur before
the "Fetching downloads for:" message is displayed.

Key changes:
- Add Cask::Installer#prelude method with @ran_prelude tracking
- Call prelude before enqueueing downloads in install/reinstall/upgrade
- Refactor to avoid creating installer objects multiple times
- Maintain backward compatibility for non-download-queue scenarios

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 14:38:24 +01:00
Luka Rajic
0c78875616 Add a way to view the size of each installed formula/cask
Change styling based on output of brew typecheck and brew style

Changes as per PR comments

Remove --leaves flag functionality

Simplify formulae and cask parsing as well as style changes as per PR comments

Update cask and formulae parsing as per PR comment suggestion

Add column formatting function as well as PR comment suggestions

Add Sorbet struct for printing and minor logic changes as per PR comments

Minor changes as per PR comments and fix formatting issue in output
2025-08-05 09:13:29 -04:00
chirsz
75b1e681b8 cmd/update: use short option in update.sh
Support the environment not supporting long option, such as Alpine Linux
with busybox.
2025-08-04 22:40:21 +08:00
Eric Knibbe
6255263b51
output: express environment variables consistently 2025-08-04 09:50:06 -04:00
Eric Knibbe
fe13aac730
Manpage: source wording & formatting fixes 2025-08-01 23:43:46 -04:00
Klaus Frank
a7da303481 fix: Add missing env var mention on upgrade help page
Add missing env defaults note for `--greedy` to `brew upgrade --help` output
2025-07-30 21:37:23 +00:00
Mike McQuaid
bafc57cfe1
Add Cask install/upgrade/reinstall support for download queue
This will allow installing/upgrading/reinstalling casks and all their
dependencies in parallel.
2025-07-30 08:18:35 +01:00
Mike McQuaid
10eb5491dc
cmd/info: don't print empty caveats.
The existing logic was insufficient so let's check the actual string.
2025-07-29 15:18:24 +01:00
Issy Long
e524b7dd47
cmd/search: --desc depends on --eval-all, not the other way around
- When the user tried `brew search foo` with `--eval-all` or its
  envvar, it would fail with
  `Error: Invalid usage: `--eval-all` cannot be passed without `--desc`.`
- This was the wrong way around: `--desc` depends on `--eval-all`.
2025-07-24 22:58:16 +01:00
Mike McQuaid
e10d4c43c2
Optionally use DownloadQueue for reinstall, upgrade.
Follow up on `DownloadQueue` for download concurrency on `brew fetch`
and `brew install` to also add support for `brew reinstall` and
`brew upgrade`.

This required a fair bit of refactoring to make this work so I've also
made `install.rb`, `reinstall.rb` and `upgrade.rb` `typed: strict` to
add some extra guardrails from Sorbet here.

Co-authored-by: Carlo Cabrera <github@carlo.cab>
2025-07-24 15:41:03 +01:00
Mike McQuaid
e5d940fdaa
Improve Download Queue behaviour
- ensure that the `brew.rb` downloads of the API files only happens
  when they are more stale (>1 day) and using the API is not disabled
- default `brew fetch` and `brew install` to a single download retry

Co-authored-by: Carlo Cabrera <github@carlo.cab>
2025-07-21 09:10:06 +01:00
Mike McQuaid
21e9db69c8
Merge pull request #20276 from gromgit/bundle/local-global
bundle: --file and --global should conflict
2025-07-18 14:15:00 +00:00
Adrian Ho
464e857344 bundle: --file and --global should conflict
Addresses https://github.com/orgs/Homebrew/discussions/6292.
2025-07-18 18:47:56 +08:00
Mike McQuaid
a3d6ee1d2a
Refactor DownloadQueue handling
- Use undocumented (for now) `HOMEBREW_DOWNLOAD_CONCURRENCY` instead
  of `--concurrency` flag and avoid passing around `concurrency`
- Create and use `Formula#enqueue_resources_and_patches` helper method
- Rename some method calls to be more obvious
- Use `Downloadable` type to simplify type checks
- General refactoring
2025-07-17 17:49:53 +01:00
Eric Knibbe
d31b7fe86e
Add docs for brew alias command 2025-07-15 13:34:49 -04:00
Patrick Linnane
4513a43d53
Fix RuboCop failures.
Co-authored-by: Patrick Linnane <patrick@linnane.io>
Co-authored-by: Carlo Cabrera <github@carlo.cab>
Co-authored-by: Thierry Moisan <thierry.moisan@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-07-14 19:12:38 +01:00
Mike McQuaid
f4e629331f
Move more logic from cmd/fetch to download_queue
This is the first step towards using the download queue for all
download operations e.g. `brew install`, `brew upgrade`,
`brew reinstall` etc.

While we're here, do some API cleanup and Sorbet type improvements.
2025-07-11 16:57:41 +01:00
Douglas Eichelberger
43b72d3633
Merge pull request #20213 from Homebrew/dug-20205
Exit non-zero when pinning uninstalled formula
2025-07-04 21:56:14 +00:00
Issy Long
ce8bf906c1
Retain the old brew bundle --brews flag for compatibility
https://github.com/Homebrew/brew/pull/20209#discussion_r2186099917
2025-07-04 22:02:59 +01:00
Douglas Eichelberger
e78cc286e0
Keep exiting zero on already pinned formulae 2025-07-04 13:55:12 -07:00
Douglas Eichelberger
f4bcda325a
Exit non-zero when pinning uninstalled formula 2025-07-04 13:28:54 -07:00
Issy Long
495b5bedde
Merge pull request #20209 from Homebrew/bundle-rename-brews-to-formulae
bundle: Rename "brews" to "formulae" for consistency
2025-07-04 20:21:38 +00:00
Issy Long
990c1efc16
bundle: Rename "brews" to "formulae" for consistency
- 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.)
2025-07-04 21:08:37 +01:00
Eric Knibbe
a7471e449e
cmd/info: fix brew info <formula> 2025-07-04 10:33:11 -04:00
Eric Knibbe
f5c5d26173
cmd/dev-cmd: fetch HOMEBREW_EVAL_ALL for --eval-all 2025-07-03 12:59:12 -04:00
Issy Long
019a799fae
Merge pull request #20128 from Homebrew/some-bundle-files-werent-typed-at-all
Make the remaining `bundle` files `typed: true`
2025-06-29 23:10:59 +00:00
Douglas Eichelberger
004c0a2a6c
Refactor exec.rb type fixes 2025-06-29 09:02:24 -07:00
Bo Anderson
98b7bc8d11
cmd/update: ensure local branch moves to main 2025-06-27 22:05:17 +01:00