99 Commits

Author SHA1 Message Date
Thibaut Hérault
a6aad3d12f
Update Library/Homebrew/upgrade.rb
Co-authored-by: Carlo Cabrera <github@carlo.cab>
2025-07-01 09:59:54 -04:00
thibhero
006d3779f3 returning early if upgradeable is blank
resolves #20197
2025-06-30 10:58:33 -04:00
thibhero
c5036f3bba removing debugging symbols 2025-06-29 23:24:04 -04:00
thibhero
dfab4bbab2 removing formula previously updated 2025-06-29 23:18:38 -04:00
thibhero
2d39c7feb5 making flow easier to understand 2025-06-20 16:41:32 -04:00
thibhero
a16129fc59 new line to make it easier to understand 2025-06-20 12:36:22 -04:00
thibhero
6d0a77fc79 fixing method refactoring 2025-06-20 12:32:46 -04:00
thibhero
7d7d04bdf5 Merge remote-tracking branch 'tyuwags/master' 2025-06-20 12:29:08 -04:00
thibhero
0db36b57c8 fetching tab and renaming variables 2025-06-20 12:25:55 -04:00
Thibaut Hérault
0800faf093
Update Library/Homebrew/upgrade.rb
Co-authored-by: Bo Anderson <mail@boanderson.me>
2025-06-20 11:10:36 -04:00
thibhero
19901b5332 refactoring style to resolve the last discussions 2025-06-18 16:05:19 -04:00
thibhero
8c203df671 trying to remove FormulaInstaller.installed to formulae 2025-06-17 19:20:43 -04:00
thibhero
d525e25e99 resolving discussions 2025-06-11 22:41:22 -04:00
thibhero
7e876e4681 resolving discussions 2025-06-11 22:35:00 -04:00
thibhero
32a53ab285 resolving error typecheck 2025-06-09 00:42:24 -04:00
thibhero
aa47105d2a refactoring code 2025-06-09 00:14:16 -04:00
thibhero
27f7f282be refactoring homebrew upgrade for ask option 2025-06-08 11:31:40 -04: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
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
Bo Anderson
e91ed65aef
upgrade: remove module_function 2024-08-20 15:33:08 +01:00
Bo Anderson
77204e01da
reinstall: move to submodule 2024-08-20 03:58:01 +01:00
Issy Long
45978435e7
rubocop: Use Sorbet/StrictSigil as it's better than comments
- Previously I thought that comments were fine to discourage people from
  wasting their time trying to bump things that used `undef` that Sorbet
  didn't support. But RuboCop is better at this since it'll complain if
  the comments are unnecessary.

- Suggested in https://github.com/Homebrew/brew/pull/18018#issuecomment-2283369501.

- I've gone for a mixture of `rubocop:disable` for the files that can't
  be `typed: strict` (use of undef, required before everything else, etc)
  and `rubocop:todo` for everything else that should be tried to make
  strictly typed. There's no functional difference between the two as
  `rubocop:todo` is `rubocop:disable` with a different name.

- And I entirely disabled the cop for the docs/ directory since
  `typed: strict` isn't going to gain us anything for some Markdown
  linting config files.

- This means that now it's easier to track what needs to be done rather
  than relying on checklists of files in our big Sorbet issue:

```shell
$ git grep 'typed: true # rubocop:todo Sorbet/StrictSigil' | wc -l
    268
```

- And this is confirmed working for new files:

```shell
$ git status
On branch use-rubocop-for-sorbet-strict-sigils
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Library/Homebrew/bad.rb
        Library/Homebrew/good.rb

nothing added to commit but untracked files present (use "git add" to track)

$ brew style
Offenses:

bad.rb:1:1: C: Sorbet/StrictSigil: Sorbet sigil should be at least strict got true.
^^^^^^^^^^^^^

1340 files inspected, 1 offense detected
```
2024-08-12 15:24:27 +01:00
Bo Anderson
993a0aec3a
upgrade: fix missed upgrades when an alias is changed to a formula 2024-08-03 01:49:40 +01:00
Markus Reiter
0b56d0be4a
Document Tab.for_keg and use Keg#tab where possible. 2024-04-28 20:50:13 +02:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Nate Whetsell
ed3072646f Output version upgrade info using puts 2024-03-27 17:44:09 -04:00
Mike McQuaid
f1f92d28bf
Merge branch 'master' into lail/add-overwrite-flag-to-brew-upgrade 2024-03-08 08:27:04 +00:00
Bob
3d24da1904 Add support for the --overwrite flag to brew upgrade to govern the keg-linking step
`FormulaInstaller` already supports this (https://github.com/Homebrew/brew/pull/12691) but I didn't wire it up via `brew upgrade` and the two can be used largely interchangeably
2024-03-07 13:13:28 -08:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Issy Long
f4218a6316
Fix RuboCop Performance/MapCompact offenses
- Rename an iterator variable since it would make the line too long.
2024-02-25 22:59:59 +00:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
apainintheneck
b3a6e59f96 cmd/pin: Update pinned formula messaging
The hope is that this will be clearer and less annoying for users.

A user came to us a couple weeks ago stating that it was confusing
that the `brew upgrade` command printed an error when a pinned
formula had a new version available and didn't get upgraded.

This PR changes that message to a warning from an error. While looking
into this we found that there is another message that gets printed
when a package dependency doesn't get upgraded because it is pinned
and that got turned into a warning from a normal message. Honestly,
that should be more worrying for the user anyway; it could lead to
a program not working correctly in the worst case.

I also added a message to the `brew pin` command warning about
potential unintended behavior if a dependency gets pinned and another
package requires a newer version of it.

Lastly, I added a commented out deprecation notice for the
`brew upgrade --ignore-pinned` command since it's now the default.
2023-12-07 23:43:02 -08:00
Bo Anderson
7c20e1ef7c
Don't reinstall dependency when latest already installed 2023-11-14 17:13:34 +00:00
Bo Anderson
19f27f9a20
Store and use revision, where possible, in tab runtime dependencies.
Let's start storing `revision` and `pkg_version` for tab runtime
dependencies and use them when available.

When the `revision` is not available, use a conservative approach to
deciding whether dependencies need to be upgrade.

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-11-10 18:24:43 +00:00
Mike McQuaid
72ded32393
upgrade: more liberal formula upgrade changes.
Download the bottle manifests for the potential formulae we are going to
upgrade and, if they are have all their `runtime_dependencies` versions
currently met, don't try to download the bottle or upgrade the formula.
2023-09-04 22:18:55 -04:00
Mike McQuaid
8a2a16d521
WIP 2023-09-03 15:07:48 -04:00
Mike McQuaid
1d4a24d226
Make more warnings quiet with environment hints disabled.
Combined with https://github.com/Homebrew/homebrew-test-bot/pull/963
this should make `brew test-bot` output a bit quieter and less annoying.
2023-08-04 09:36:27 +01:00
Dustin Rodrigues
b776fb32de
change includecount to include_count for readability 2023-03-20 07:23:17 -04:00
Dustin Rodrigues
e5fba88035
use includecount argument in pluralize 2023-03-19 23:35:47 -04:00
Issy Long
60d93310af
rubocop: Drop "a" and "b" from Naming/MethodParameterName allowlist 2023-03-11 00:17:28 +00:00
Douglas Eichelberger
0eccc0e987 git grep -l Utils::Inflection | xargs gsed -i 's|Utils::Inflection|Utils|g' 2023-02-27 20:18:27 -08:00
Douglas Eichelberger
3da68651e5 Port more call sites 2023-02-27 20:18:08 -08:00
Douglas Eichelberger
7fb87abefd
Enable typing in Homebrew::Upgrade 2023-02-15 14:24:58 +00:00
hyuraku
5491f7b1bd share Install.print_dry_run_dependencies 2022-09-03 16:01:55 +09:00
hyuraku
66817c0c32 repair how to show formula to be installed 2022-08-17 22:14:20 +09:00
hyuraku
634fcad1b2 add dry-run option to formula#install 2022-08-16 21:01:07 +09:00
Lukas Oberhuber
d195f22522 Connecting up --debug-symbols flag
This connects the calling of dsymutil and the retention of temporary
files. Still need to connect compilation to flag.
2022-07-26 12:15:53 +01:00
rogerdpack
e360b9c6fd
cmd/upgrade: clarify why it is upgrading dependents.
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2022-02-25 15:59:48 +00:00
Bo Anderson
6e116ffbf3
Merge pull request #12484 from Bo98/core-versioned-dependent-check
upgrade: skip dependent check on core versioned formulae
2021-12-02 02:09:18 +00:00
Carlo Cabrera
ea72daf7bb
upgrade: fix undefined method error
Fixes Homebrew/discussions#2567.
2021-12-01 00:42:06 +08:00