144 Commits

Author SHA1 Message Date
William Ma
fa7bd3bff6 args: Migrate usage of args loading methods to args.named 2020-08-23 09:02:20 -04:00
Markus Reiter
b48bc316e0 Use CLI::Parser for cask commands. 2020-08-13 05:15:15 +02:00
William Ma
907d4d7f74 Add shared methods for uninstalling, reinstalling casks 2020-08-05 11:04:40 -04:00
Markus Reiter
d4c2ffd705 Refactor CLI::Parser. 2020-07-31 15:07:17 +02:00
Markus Reiter
c470a6ff43 Pass args directly to prevent_build_flags. 2020-07-30 03:21:12 +02:00
Markus Reiter
20bd4280ff Pass args.cc to Install. 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
Markus Reiter
c0d42dd922 Remove --force from global_options. 2020-07-28 10:31:11 +02:00
Markus Reiter
8a1f8ab858 Pass args to FormulaInstaller instead of using global args. 2020-07-25 04:21:21 +02:00
William Ma
525d1ac27d Fix PR issues 2020-07-03 10:33:38 -04:00
William Ma
3459931a8d Merge branch 'master' into integrate-uninstall-reinstall 2020-07-02 15:13:10 -04: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
William Ma
f3ae2fdfdc reinstall: Replace with more specific imports 2020-06-30 13:22:21 -04:00
William Ma
dff61c9eab style: Fix style issues 2020-06-30 12:21:21 -04:00
William Ma
8a05b5258a args: Refactor to load casks directly 2020-06-30 12:08:03 -04:00
William Ma
d1004c8143 reinstall: Add ability to reference casks from brew reinstall 2020-06-24 15:03:35 -04:00
Mike McQuaid
a7fe0ed847
cmd: use more and cleanup new args APIs. 2020-03-05 09:40:15 +00:00
Samuel Cochran
4c91ca06db
Add --interactive to brew reinstall
More often than I realised, I want to `brew reinstall
--build-from-source --interactive $FORMULA` to add some custom
configuration. It seems like a useful addition?
2020-02-06 09:56:51 +11:00
Gautham Goli
959b88266d
ARGV: Replace usages of ARGV.resolved_formulae with Homebrew.args 2020-01-02 13:56:19 +00:00
EricFromCanada
90e830c19e cmd: add raises for invalid input 2019-12-15 00:04:45 -05: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
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
9354081323
Add HOMEBREW_DISPLAY_INSTALL_TIMES
Fixes #6300
2019-07-28 11:12:32 +01:00
Mike McQuaid
c4f72312ce
Fixup brew style failures. 2019-04-30 09:19:18 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
e40b171127
Rename cli_parser to cli/parser. 2019-04-17 22:16:50 +09:00
Mike McQuaid
267d721988
Note HOMEBREW_NO_INSTALL_CLEANUP in the help/manual 2019-02-03 09:34:00 +01:00
Mike McQuaid
6cb7a00f2d
cmd: remove --help headers and tweak docs. 2019-01-30 21:39:28 +00:00
Mike McQuaid
867b155479
Add missing conflicts to command options. 2019-01-29 19:39:41 +00:00
Mike McQuaid
9eabcdad7d
Make install/reinstall/upgrade options more consistent. 2019-01-29 19:25:59 +00:00
Mike McQuaid
eed1444d61
Update deprecations and cleanup
- Move `odeprecated` to `odisabled`
- Remove `odisabled`
- Enable automatic cleanup on install/reinstall/upgrade.
2019-01-23 21:57:40 +00:00
Mike McQuaid
8144667a71
Cleanup periodically if HOMEBREW_INSTALL_CLEANUP is set.
This will become the default in a later version of Homebrew but has an
opt-out through HOMEBREW_NO_INSTALL_CLEANUP.

Also, always cleanup files older than 120 days and set the general
default value for "old" logs, casks etc. to 30 days.
2019-01-03 16:23:44 +00:00
Mike McQuaid
069b7e89a9
reinstall: add build-from-source switch.
Fixes #5431.
2018-11-24 15:36:59 +00:00
Gautham Goli
75aae9c8a8
reinstall: Add verbose flag 2018-11-13 17:28:22 +05:30
Gautham Goli
2736aed1fd
reinstall: Use CLI::Parser to parse args 2018-11-07 22:33:32 +05:30
Jarek Wojciechowski
6c2f41b90c Update docs and manpage for HOMEBREW_INSTALL_CLEANUP 2018-10-30 10:19:45 -04:00
Jarek Wojciechowski
51ca60d6d5 add formula cleanup to install and reinstall 2018-10-29 11:23:32 -04:00
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
Mike McQuaid
7615d3a812
Improve writable directory handling
Consolidate the handling of which directories need to exist and which
need to be writable. Additionally, add a fatal check for formula
installations to ensure that any directories that need to be writable
are so before attempting an installation.

Fixes #4626.
2018-09-06 18:38:43 +01:00
Andrew Janke
0a2d8c3d4d Add --display-times option to install, reinstall, and upgrade 2018-07-14 11:06:03 -04:00
Andrew Janke
c644392a85 Display collected caveats at end of install or upgrade 2018-07-12 20:41:32 -04:00
Mike McQuaid
e03f07f302 Rubocop 0.53.0 automatic fixes. 2018-03-08 14:10:02 +00:00
Chayoung You
b05d69f600
Format identifiers in oh1 2018-02-09 18:00:29 +09: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
7eb1fd6671 reinstall/upgrade: document use of options.
To avoid user confusion e.g. #3606.
2017-12-30 21:23:33 +00: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