315 Commits

Author SHA1 Message Date
Markus Reiter
f8934c0255 Pass args in Install and Messages instead of using global args. 2020-07-30 03:21:12 +02:00
Markus Reiter
c0d42dd922 Remove --force from global_options. 2020-07-28 10:31:11 +02:00
Misty De Meo
f6468ecf00 upgrade: avoid upgrading unrequested casks
Fixes #8107.
2020-07-27 13:25:35 -07:00
Mike McQuaid
2ff56c9e71
Merge pull request #7927 from MLH-Fellowship/integrate-cask
Allow references to casks when running upgrade and outdated
2020-07-27 15:11:32 +01:00
Markus Reiter
8a1f8ab858 Pass args to FormulaInstaller instead of using global args. 2020-07-25 04:21:21 +02:00
William Ma
299db98dbf Fix PR issues 2020-07-16 23:31:26 +10:00
William Ma
ad04284a20 upgrade: Move logic to find outdated formulae into upgrade method 2020-07-16 23:31:26 +10:00
William Ma
210d22e819 Integrate upgrade with cask 2020-07-16 23:31:26 +10: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
Mike McQuaid
e1f3c8d2b3
Merge pull request #7579 from MikeMcQuaid/deprecations
Update deprecations
2020-05-23 14:38:10 +01:00
Mike McQuaid
11cf77be17
formula_installer: prelude before fetch.
This ensures that dependencies are verified and tapped before they are
fetched. `FormulaInstaller#lock` has been moved into
`FormulaInstaller#install` to avoid locking until necessary.

While we're here, don't compute dependencies before fetching if we're
not going to use them.
2020-05-23 13:40:13 +01:00
Mike McQuaid
4f75a77b08
Update deprecations
Add more deprecations, disable deprecations and remove disabled code.
2020-05-18 13:50:46 +01:00
Mike McQuaid
08a9f0e1c0
Use FormulaInstaller#fetch before #prelude. 2020-05-11 09:38:26 +01:00
Michelle Nguyen
2264c08cee
Fetch formula resources before unlinking during upgrade.
Fixes #6374.
2020-05-11 09:37:56 +01:00
Mike McQuaid
4e5c8a35e5
cmd/upgrade: handle nil runtime_dependencies.
Fixes #7360
2020-04-15 10:52:48 +01:00
Mike McQuaid
a7fe0ed847
cmd: use more and cleanup new args APIs. 2020-03-05 09:40:15 +00:00
Boris Klimenko
00aa4b7a0b
Apply suggestions from code review
Co-Authored-By: Bo Anderson <mail@boanderson.me>
2020-02-26 16:49:48 +03:00
Boris Klimenko
4bde62b651
Apply suggestions from code review
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2020-02-26 15:56:45 +03:00
Boris Klimenko
22375bae7c
Fix style 2020-02-26 13:49:12 +03:00
Boris Klimenko
da5d804bd9
Inline versions of upgraded formulae 2020-02-26 13:42:18 +03:00
Mike McQuaid
ac97c8545a
cmd/upgrade, reinstall: don't install on dry-run.
Fixes #7033.
2020-02-14 12:18:55 +00:00
Samuel Cochran
b922ebec2a
Add --interactive to brew upgrade 2020-02-06 09:57:49 +11:00
Mike McQuaid
45409618df
cmd/upgrade: fix pinned dependent handling.
Ensure they aren't upgraded or reinstalled even if they are outdated.

Fixes #6898.
2020-01-07 19:38:50 +00:00
Gautham Goli
959b88266d
ARGV: Replace usages of ARGV.resolved_formulae with Homebrew.args 2020-01-02 13:56:19 +00:00
Mike McQuaid
3b2cbf2ffa
upgrade: make dry-run check dependents too.
Fixes #6883
2020-01-01 15:04:50 +00:00
Gautham Goli
685a6b4da6 ARGV: Replace usages of ARGV.named with Homebrew.args.named 2019-12-18 20:38:21 +05:30
Bob Lail
a26390be05 Fix bug with printing pinned dependencies.
Brew prints this error:
```
Error: undefined method `join' for nil:NilClass
```

because, in this code:

```ruby
puts pinned_dependents.map do |f|
  "#{f.full_specified_name} #{f.pkg_version}"
end.join(", ")
```
the block is passed to `puts` and not to `map`. `.join(",")` is called on the output of `puts`.

(I think the regression was introduced in this commit: e12a7b0808353ea81d63774be1edaff81710d7a6)
2019-12-04 12:31:01 -06:00
Mike McQuaid
d6d857c154
cmd/upgrade: fix exit logic.
Fixes #6739
2019-11-14 07:22:19 -08:00
Mike McQuaid
9d2cb8e9b3
upgrade: don't error if already installed.
I've been convinced idempotency is a good thing for this command so this
would be a good thing to get out for 2.2.0.
2019-11-12 16:18:54 -08:00
Mike McQuaid
e8c241f56c
upgrade: fix handling broken dependents.
Ensure that we use the keg for checking linkage but that the dependents
returned are still formulae.

Fixes #6715.
2019-11-11 10:08:08 +00:00
Paul
2e55eac802
'upradable' typo for 'upgradeable_dependents' 2019-11-07 22:58:02 +07:00
Mike McQuaid
81e6359aeb
upgrade: tweak dependent messaging.
Output more without requiring `--verbose` and update the messages to
make clear what we're looking for and what we found/didn't find.

This is a little more noisy but it should help explain any delays to
users and make it more obvious what's failed if something does.
2019-11-06 11:38:17 +00:00
Mike McQuaid
e12a7b0808
upgrade: simply check_dependents, remove recursion. 2019-11-06 10:21:31 +00:00
Mike McQuaid
0cf6052fcc
cmd/upgrade: comment-out broken_dependents functionality.
This is not a fix for https://github.com/Homebrew/brew/issues/6671 but
will stop people hitting this bug for now.
2019-11-05 09:51:17 +00:00
Issy Long
d0c3885f31
Merge pull request #6592 from issyl0/bump-rubocop-target-ruby-version
Bump Rubocop's `TargetRubyVersion` to 2.6 and fix all offenses
2019-10-14 09:39:21 +01:00
Issy Long
341ea60807
Auto-fix Style/RedundantBegin offenses
- This also required auto-fixes for Layout/EmptyLinesAroundBlockBody and
  Layout/InconsistentIndentation once the auto-fixer had got rid of the
  "redundant begin"s.
2019-10-13 16:04:27 +01:00
L. E. Segovia
024007f9e2
upgrade: address @MikeMcQuaid's comments 2019-10-12 22:06:08 +00:00
L. E. Segovia
f4707a8041
upgrade: reject formulae checked in earlier levels 2019-10-12 15:53:21 +00:00
Gautham Goli
393c8dfbf1 ARGV: Replace options_only and flags_only with Homebrew.args counterparts 2019-09-23 12:39:22 +05:30
Kristof Lünenschloß
3e46488ca4 Display packages to upgrade one package per line 2019-09-13 13:43:34 +02:00
Mike McQuaid
7df0292f9b
Revert "argv: move flags_only to cli/args" 2019-09-13 09:12:26 +01:00
Gautham Goli
c7681c4287 argv: move flags_only to cli/args 2019-09-09 14:51:36 +05:30
EricFromCanada
2477773259 man: include global options with customized descriptions 2019-08-25 23:59:47 -04:00
L. E. Segovia
b3a1f34b7b
upgrade: style fixes 2019-08-23 01:51:06 +00:00
L. E. Segovia
efb200e825
breadth-first search for dependents upgrade
Fixes Homebrew/brew#6386
2019-08-22 12:38:28 +00:00
EricFromCanada
8a8359cdd4 manpages: sentence rewording for readability
Use active voice when applicable, better verbs & adjectives, preposition usage, proper tense, etc.
2019-08-20 09:05:45 -04:00
EricFromCanada
ee314617f7 manpages: update command usage strings 2019-08-20 08:55:54 -04:00
EricFromCanada
6520785307 manpages: grammar fixes 2019-08-20 08:26:26 -04:00
EricFromCanada
a3e0647797 manpages: whitespace fixes 2019-08-20 08:24:20 -04:00
Mike McQuaid
1cd45a769d
Merge pull request #6330 from hogand/add-upgrade-dry-run
Add --dry-run to brew upgrade and brew cask upgrade
2019-07-28 15:18:13 +01:00