31 Commits

Author SHA1 Message Date
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
Steve Peters
c04631320c upgrade: deduplicate list of outdated dependents
Use `uniq` on the list of outdated dependents to remove
duplicates, similar to a change made in #8500.
2020-09-18 00:58:53 -07:00
Seeker
5def0701ba formula: rename opt_or_installed_prefix_keg to any_installed_keg 2020-09-01 09:39:20 -07:00
Steve Peters
24e7f55a4c Create check_broken_dependents method 2020-08-30 01:24:42 -07:00
Steve Peters
bdfaaf7940 upgrade: check for already broken dependents
After upgrading a formula, it currently checks for
broken dependents after upgrading any outdated dependents.
If there are no outdated dependents, it exits early
and doesn't check for broken dependents.
This adds an earlier check for already broken dependents
so they can be fixed even if there are no outdated dependents.
2020-08-26 11:29:08 -07:00
Steve Peters
12070b4c0f upgrade: fix undefined method
Add the `Homebrew.` module prefix to fix an undefined method.
Also, use `uniq` to deduplicate the list of broken dependents.
2020-08-26 09:42:18 -07:00
Markus Reiter
4937e4bbc3 Refactor and document Upgrade. 2020-08-24 19:42:24 +02:00
Markus Reiter
3d78bc2111 Fix upgrade --build-from-source. 2020-08-10 06:13:27 +02:00
Markus Reiter
490e503b1b Replace Homebrew.args with Context. 2020-08-06 16:13:14 +02:00
Markus Reiter
6c964d4a78 Pass verbose? to Keg#link, Keg#unlink and Keg#optlink. 2020-08-06 16:12:52 +02:00
Markus Reiter
e9d8f09da1 Pass debug?, quiet? and verbose? to FormulaInstaller. 2020-08-06 16:12:52 +02:00
Markus Reiter
7926f7fc82 Pass args.verbose? to BuildError#dump. 2020-08-06 16:12:52 +02:00
Bo Anderson
ab15c97c61 Fix dependents building from source when not requested 2020-08-02 00:46:17 +01:00
Markus Reiter
6b0678e8ed Remove args from FormulaInstaller. 2020-07-30 03:21:12 +02:00
Markus Reiter
620ca4177e Pass args to FormulaInstaller instead of using global args. 2020-07-30 03:21:12 +02:00
Markus Reiter
f8934c0255 Pass args in Install and Messages instead of using global args. 2020-07-30 03:21:12 +02:00
Dustin Rodrigues
e02d08f020 re-enable build from source for install, reinstall, upgrade 2020-07-25 22:27:54 -04:00
Markus Reiter
8a1f8ab858 Pass args to FormulaInstaller instead of using global args. 2020-07-25 04:21:21 +02:00
Bo Anderson
6a49d29b08 upgrade: fix error checking dependents 2020-07-04 18:05:31 +01:00
Mike McQuaid
2c133a3d45
Check installed dependents on install and reinstall
It's not sufficient to do this merely on `brew upgrade` because
`brew install` and `brew reinstall` can also result in formulae being
upgraded.

This requires moving logic from `cmd/upgrade.rb` to `upgrade.rb`. To
save you searching the diff the changes that resulted from doing that:

- Query the installed formulae from class state in `FormulaInstaller`
  rather than the (incomplete) list that we passed into it.
- Don't output the "Checking dependents" message. It was there for
  systems and configurations where this is slow but for most users
  and most installations this will be a (annoying, noisy) no-op.

Fixes https://github.com/Homebrew/brew/issues/7860
2020-07-02 12:53:52 +01:00