69 Commits

Author SHA1 Message Date
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
Carlo Cabrera
b30d821a9c
Tweak warning message wording
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-11-29 20:42:41 +08:00
Carlo Cabrera
4b36a0eee5
upgrade: don't upgrade unbottled dependents of upgraded formulae
We upgrade dependents of upgraded formulae to make sure that an upgrade
doesn't break anything. However, this reasoning applies only when a
dependent is bottled, since attempting a source build is just as likely
to break things, if not more.

I've opted not to restrict this to, say, users only on outdated versions
of macOS in order to cleanly handle other cases where this change should
also apply: Linux, or current versions of macOS in a non-default prefix.
2021-11-27 15:51:57 +08:00
Mike McQuaid
6913c7c84e
Output environment variable hints.
Output hints for disabling automatic `brew update`, `brew cleanup` and
`brew upgrade`/`brew reinstall` of dependents. Also provide a
`HOMEBREW_NO_ENV_HINTS` to disable this messaging.
2021-11-26 13:14:10 +00:00
Bo Anderson
d47344b1e8
upgrade: skip dependent check on core versioned formulae 2021-11-26 13:05:50 +00:00
Mike McQuaid
11c5f8f05a
Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:

- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents

For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves.
2021-11-25 09:10:59 +00:00
Bo Anderson
9d5f4e8ed5
Fix undefined method error following CannotInstallFormulaError 2021-09-14 10:43:38 +01:00
fn ⌃ ⌥
5a94c43b3f install, upgrade: fix installation attempt check 2021-09-13 10:28:13 -07:00
Mike McQuaid
1a904af264
Merge pull request #12018 from FnControlOption/upgrade-tsort
upgrade: use topological sort to upgrade formulae
2021-09-12 19:26:22 +01:00
fn ⌃ ⌥
c0795b5029 upgrade: raise error if developer and there are cyclic dependencies 2021-09-12 07:56:37 -07:00
fn ⌃ ⌥
15e8852128 upgrade: add install_formula helper method 2021-09-10 08:39:36 -07:00
fn ⌃ ⌥
0c3afa5837 install, upgrade: run formula installer prelude before fetching 2021-09-10 06:15:55 -07:00
fn ⌃ ⌥
0c3e49092c upgrade: use topological sort to upgrade formulae 2021-09-09 13:41:50 -07:00
fn ⌃ ⌥
eec60c4086 install, upgrade: don't print message if formula already installed 2021-09-09 10:54:18 -07:00
FnControlOption
03177b5906 upgrade: revert renaming of create_formula_installer 2021-09-01 05:48:12 -07:00
EricFromCanada
c234d1ea03
upgrade: list upgradeable dependencies/migrations/cleanups on dry run 2021-08-31 12:27:14 -04:00
Mike McQuaid
3e1c8ea877
Apply suggestions from code review 2021-08-31 16:35:09 +01:00
FnControlOption
16594c5521 upgrade: fetch_formula_installer -> create_formula_installer 2021-08-31 07:08:24 -07:00
FnControlOption
f45c1146fc upgrade: fetch all formulae before installing 2021-08-30 08:17:28 -07:00
Connor Mann
13e1457249
Consolidate shared install and upgrade logic 2021-06-15 10:11:40 -04:00
Bo Anderson
0deddcfd9f
upgrade: fix broken dependents never being built from source 2021-04-27 17:16:15 +01:00
Bo Anderson
8e98ce69f3
Stricter handling of CLI args 2021-03-18 16:41:57 +00:00
EricFromCanada
f5e1557154 use ofail to set Homebrew.failed 2021-01-26 15:36:43 -05:00
Markus Reiter
6d850a97a1
Merge pull request #9182 from reitermarkus/formula-installer
Refactor `FormulaInstaller`.
2020-11-19 20:18:57 +01:00
Markus Reiter
7c5d8a5288 Refactor FormulaInstaller. 2020-11-18 09:30:11 +01:00
EricFromCanada
bcdb0c7698 upgrade: show upgradeable dependents during dry run 2020-11-17 18:26:35 -05:00
Rylan Polster
50890ebd51 fix Lint/DuplicateBranch style 2020-11-16 02:02:52 +01:00
Mike McQuaid
ffe827ad0e
Fix upgrading dependents on missing keg
Ensure that we don't try to check for broken linkage in a keg that
doesn't exist. Furthermore, fix the reason we checked for the keg that
doesn't exist by `Formula.clear_cache`.

While here, I noticed that there was other methods of caching at use in
`Formula` so consolidate them to be consistent.

Fixes #8997
2020-10-29 08:31:04 +00:00
Muneeb Ahmed
4322b44d4c Refresh installed list before dependency check 2020-10-26 19:29:55 -07:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Mike McQuaid
95cd1de2a5
HOMEBREW_NO_CHECK_INSTALLED_DEPENDENTS: add variable.
Add an opt-out of this behaviour.
2020-10-06 10:50:51 +01:00