136 Commits

Author SHA1 Message Date
L. E. Segovia
d442905719
Upgrade: implement linkage repair
After upgrading existing kegs, we now search and upgrade their
dependents as well. If any are detected that have broken linkage, they
are reinstalled from source.

If there are any formulae in the dependents tree that are pinned, they
are only reinstalled if they're not outdated; in all cases, a suitable
message is printed detailing the kegs that will be acted upon.
2018-09-12 19:28:02 +00:00
JBallin
520b5a103a Clarify that --cleanup only runs on formulae which were just upgraded 2018-08-16 09:28:24 -07:00
JBallin
526262fca5 Change <formula> to <formulae> to match the suggested inputs 2018-08-16 09:28:24 -07:00
Markus Reiter
03b93da296 Use option parser for brew cleanup. 2018-08-08 13:11:16 +02:00
Mike McQuaid
bd5131d710
Merge pull request #4392 from MikeMcQuaid/more-deprecation-disabled
Disable more deprecations.
2018-07-15 14:48:00 +01:00
Andrew Janke
0a2d8c3d4d Add --display-times option to install, reinstall, and upgrade 2018-07-14 11:06:03 -04:00
Mike McQuaid
5c6ef3d920 Disable more deprecations.
- Turn more old `odeprecated` into `odisabled`
- Remove more old `odisabled`
- Remove code for older Ruby versions
2018-07-14 16:00:50 +01:00
Andrew Janke
c644392a85 Display collected caveats at end of install or upgrade 2018-07-12 20:41:32 -04:00
Andrew Janke
8b55cb5ecb Refactor commands to remove "require cmd/help" 2018-06-07 04:59:59 -04:00
Mike McQuaid
cffa5a9864 Disable/delete/add more deprecations
Move various `odeprecated` to `odisabled` and delete uses of
`odisabled`.
2018-04-08 14:57:17 -07:00
Mike McQuaid
5b68bb84d2 cmd/upgrade: output the outdated version.
This makes it clearer what version is being updated to what version.
2018-03-30 15:00:45 +01:00
Mike McQuaid
96ff688b9d upgrade: make pinned error have correct exit code.
Also, display before saying "no packages to upgrade".

Fixes #3936.
2018-03-16 20:31:20 +00:00
Mike McQuaid
e817bba18d upgrade: add HOMEBREW_UPGRADE_CLEANUP variable.
Allow users to specify they want `brew upgrade --cleanup` to always be
run when they run `brew upgrade`.
2018-03-12 11:05:06 +00:00
Peter Powell
e71b2d1737 upgrade: fix the man page wrongly saying that it will upgrade pins.
This is incorrect as in order to upgrade a pinned package it must
first be unpinned.
2018-03-10 12:07:13 +00:00
Mike McQuaid
e03f07f302 Rubocop 0.53.0 automatic fixes. 2018-03-08 14:10:02 +00:00
Teddy Wing
ee004cb9c7 cmd/upgrade: Change build.build_bottle? to build.bottle?
I received the following error when attempting to use the `upgrade`
command on a tap:

    $ brew tap teddywing/passextract https://github.com/teddywing/Passextract.git
    $ brew upgrade --verbose teddywing/passextract/passextract
    Updating Homebrew...

    ==> Upgrading 1 outdated package, with result:
    teddywing/passextract/passextract 0.4.0
    Error: Calling build.build_bottle? is disabled!
    Use build.bottle? instead.
    /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:121:in `upgrade_formula'
    Or, even better, submit a PR to fix it!

Change the method call to use the (presumably) newer version.
2018-03-04 12:38:33 +01:00
Chayoung You
b05d69f600
Format identifiers in oh1 2018-02-09 18:00:29 +09:00
Mike McQuaid
3a2e6b82fd Make pinning more robust
Don’t autoremove pins on uninstall or upgrade and note this in the
manpage.
2018-02-05 10:59:11 +00:00
Mike McQuaid
de0fedeb09 upgrade --all: use odeprecated. 2018-01-21 13:39:14 +00:00
Mike McQuaid
838a3f1996 reinstall/upgrade: stop unlinked kegs being sticky
It's not possible to determine the difference between a non-keg-only
keg that failed to link and one that wasn't linked by us intentionally.

To avoid additional complexity of storing this logic in another place
let's back out this relatively new functionality; sticky keg-only links
is a better and more desirable behaviour anyway.
2018-01-10 16:43:21 +00:00
Mike McQuaid
9ed1ed3c05 upgrade: fix UnsatisfiedRequirements exit code. 2018-01-09 09:07:37 +00:00
Mike McQuaid
dbeebcaef5 upgrade: skip formula if upgrade fails.
Rather than blocking the rest of the formulae from being installed by
`brew upgrade` print the requirement failure messages (already done) and
an error stating requirements weren't satisfied and then continue to
upgrade the rest of the formulae.
2018-01-08 14:38:10 +00:00
Mike McQuaid
7eb1fd6671 reinstall/upgrade: document use of options.
To avoid user confusion e.g. #3606.
2017-12-30 21:23:33 +00:00
L. E. Segovia
9603e39f16 Rename whole build_options block (copypaste from reinstall) 2017-12-02 20:04:03 +00:00
L. E. Segovia
da764c6d6c Delete --ignore-dependencies additions 2017-12-02 20:03:38 +00:00
L. E. Segovia
4dfe6e32e4 Let the upgrade command add new build flags 2017-12-02 17:14:46 +00:00
L. E. Segovia
5f5e689752 Remember --ignore-dependencies when installing and upgrading 2017-12-02 13:41:11 +00:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Mike McQuaid
044f4d947b Tweak preserve link status on reinstall/upgrade.
Treat a `brew install` command as normal i.e. link by default unless
keg-only and only specify whether a keg should be linked when upgrading
or reinstalling. Also, adjust the naming accordingly so it's more
obvious that this is the case.
2017-07-30 21:44:43 +01:00
Mike McQuaid
7ec0505200 Preserve link status on reinstall/upgrade.
This means if a user has manually `brew unlink` or `brew link --force`d
something then that status will be preserved after they `brew upgrade`
or `brew reinstall` that formula.

This generally should make things that are keg-only by default easier
to swallow.
2017-07-30 16:20:32 +01:00
Mike McQuaid
b8611bd988 formula_installer: simplify callers.
There's a bunch of duplication going on that's not really necessary.
2017-07-28 15:27:47 +01:00
Mike McQuaid
90c6d5f40a upgrade: perform rename migrations when needed. 2017-03-31 10:01:46 +01:00
ilovezfs
52d1d2cc3f upgrade: keg_only before non-keg_only formulae
Avoids unnecessary conflicts when a previously non-keg_only formula is
in the way by prioritizing keg_only before non-keg_only formulae.

This change is motivated by the upgrade of gnupg 2.0 to 2.1, since the
latter no longer depends on the gpg-agent formula, which, even if made
keg_only, still causes the link step to fail for 2.1, as gpg-agent's
non-keg version won't have been upgraded to the keg_only version at that
point (alphabetically gnupg precedes gpg-agent).
2017-03-17 12:39:43 -07:00
Markus Reiter
c594ffefbc Add Formatter::pluralize. 2017-03-11 21:12:51 +01:00
Mike McQuaid
f0249643d4 formula_installer: use attr_accessor for installed_* 2017-01-18 16:10:28 +00:00
Mike McQuaid
5424db1263 upgrade: temporarily comment out for fix. 2017-01-18 15:25:17 +00:00
Mike McQuaid
89d8864b6b upgrade: tab installed_{as_dependency,on_request} 2017-01-18 11:23:22 +00:00
Mike McQuaid
e347f7ade3 reinstall/upgrade/install: always output options.
This is both easier for debugging and to communicate with users what is
being done.
2016-12-10 13:07:03 +00:00
Mike McQuaid
56124f5963 Filter formula build options based on those that exist.
If `--with-foo` is provided to a formula through a tab or through
another formula depending on it and this option does not exist it
should be filtered. If it is not (the prior behaviour) then this can
prevent bottles being used unnecessarily.

Fixes #1399.
2016-11-12 12:11:55 +00:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Mike McQuaid
f17a55b269 upgrade: tell people that --all is a no-op.
Apparently this is still run by people so let's tell them to save
some typing.
2016-10-01 15:11:52 +01:00
Mike McQuaid
c9d9e54de6 Fix brew style from #971. 2016-09-19 16:04:32 +01:00
Alyssa Ross
2a683f2569 upgrade, outdated: follow alias changes 2016-09-18 19:58:09 +01:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
2c5beb0eff cmd/upgrade: fix Rubocop warnings. 2016-09-11 17:59:01 +01:00
Vlad Shablinsky
7fa9c0e977 Update --fetch-HEAD documentation 2016-08-11 09:30:59 +02:00
Uladzislau Shablinski
b8ce1fe1b2 Update upgrade/outdated documentation (#650) 2016-08-06 22:08:35 +08:00
Vlad Shablinsky
9754dbada8
Update upgrade/outdated methods for head versions
Introduce `--fetch-HEAD` option. Without this option upgrade and
outdated never fetch latest upstream commit to detect if HEAD is
outdated -- tabs are used instead. However, if option is passed,
we fetch commit from upstream, which is more time consuming,
but we can be sure that version is up-to-date or outdated.
2016-08-06 21:25:56 +08:00
Xu Cheng
a8566c9848 various: eliminate the usage of any? (#638)
`any?` is not the opposite of `empty?`. Besides the case that
`[false, nil].any?` will return false, `any?`(O(n)) has much worse
performance than `empty?`(O(1)).
2016-08-05 22:01:32 +08:00