5382 Commits

Author SHA1 Message Date
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
Bo Anderson
7f3f3c2d55
cmd/update: ensure we update remote main ref 2025-06-27 17:45:04 +01:00
Mike McQuaid
c9d3df2e54
Merge pull request #20176 from Homebrew/migrate_core_main
cmd/update: improve homebrew-core `main` migration.
2025-06-27 08:28:04 +00:00
thibhero
06cb0cd197 returning previously if there is no formulae to upgrade
resolves #20177
2025-06-26 13:06:57 -04:00
Mike McQuaid
66c11afa7c
Merge pull request #20175 from Homebrew/migrate_brew_cask_main
cmd/update: improve Homebrew/brew and homebrew-cask `main` migration.
2025-06-26 14:49:34 +00:00
Mike McQuaid
aa596d3e6b
cmd/update: improve homebrew-core main migration.
Let's avoid people sticking on the master branch unnecessarily.
2025-06-26 12:13:48 +01:00
Mike McQuaid
f649587d51
cmd/update: improve Homebrew/brew main migration.
Let's avoid people sticking on the `master` branch unnecessarily.
2025-06-26 12:11:11 +01:00
Mike McQuaid
b87d2887fe
Merge pull request #20033 from tyuwags/master
Refine ask‐option dependency resolution and strengthen tests
2025-06-26 10:52:46 +00:00
Patrick Linnane
f4491e0c8f
Merge pull request #20167 from Homebrew/update_report_display_descriptions
cmd/update-report: display descriptions for new formulae and casks.
2025-06-24 20:26:47 +00:00
Mike McQuaid
28753ef002
cmd/update-report: display descriptions for new formulae and casks.
This parses Homebrew's API JSON data to display descriptions for new
formulae and casks if available.

While we're here also add tests for ReporterHub.
2025-06-24 16:59:24 +01:00
Mike McQuaid
d661cffc1f
Switch to using main as the default branch
Homebrew/brew has moved to a `main` default branch so we can more move
references from `master` to `main`.
2025-06-24 11:14:57 +01:00
thibhero
6d0a77fc79 fixing method refactoring 2025-06-20 12:32:46 -04:00
thibhero
2fb6105f26 renaming variable 2025-06-20 12:29:02 -04:00
thibhero
19901b5332 refactoring style to resolve the last discussions 2025-06-18 16:05:19 -04:00
thibhero
fe06e04e28 refactoring install.rb and reinstall.rb after removing Formula.installed 2025-06-17 21:12:47 -04:00
Thibaut Hérault
27a040cc32
Merge branch 'master' into master 2025-06-17 20:49:18 -04:00
thibhero
971a8b40e6 refactoring as we can get dependants before installing 2025-06-17 19:21:17 -04:00
Rylan Polster
f71287c4a9
Fix type mismatch in brew info 2025-06-17 16:57:50 -04:00
Mike McQuaid
c4c66d41ef
cmd: set typed: strict 2025-06-17 16:33:16 +01:00
Mike McQuaid
6fb115d342
Merge pull request #20099 from Homebrew/more_update_main_changes
cmd/update*: more fixes to allow migration from `master` to `main`.
2025-06-13 16:25:56 +00:00
Mike McQuaid
08eae94955
cmd/update*: more fixes to allow migration from master to main.
We're not migrating Homebrew/brew to `main` yet but this will allow us
to ensure we have a `brew update` ready in future when we're ready to do
this.
2025-06-13 17:13:51 +01:00