297 Commits

Author SHA1 Message Date
Markus Reiter
7236faee25 Properly pass cask options in reinstall. 2021-01-10 20:19:38 +01:00
Vítor Galvão
5dbe54d766 Docs: non-cask binaries are not overwritten by --force 2021-01-07 21:23:06 +00:00
Mike McQuaid
1b4993c9ce
cmd/install: add comment to deprecate --env.
We don't allow this on upgrade or reinstall so let's make `StdEnv`
essentially a private, internal API.
2020-12-28 13:45:24 +00:00
hyuraku
0a97cd18a5 set default args 2020-12-17 21:14:18 +09:00
hyuraku
7be216fcbe change function name 2020-12-17 21:07:43 +09:00
hyuraku
d7f9bb6247 add function to define path 2020-12-17 21:07:43 +09:00
Markus Reiter
6d850a97a1
Merge pull request #9182 from reitermarkus/formula-installer
Refactor `FormulaInstaller`.
2020-11-19 20:18:57 +01:00
Mike McQuaid
caae165eb2
Improve brew install --quiet
- Suppress (some more) warnings when doing `brew install --quiet`
- Clarify `man brew` output that we don't suppress all warnings
  for all commands with `--quiet`

While I was doing this I noticed references to the (soon to be
deprecated) `brew switch` so:
- remove these references in `install` output
- remove a reference in the documentation
- add a comment to remind me to deprecate `brew diy`, too

Fixes #9179
2020-11-18 10:13:57 +00: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
EricFromCanada
72bc057014 manpage: fixes for formatting 2020-11-16 08:02:50 -05:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Mike McQuaid
f099256fef
install: tweak missing formula behaviour.
- Run `brew search` for local formulae first (as it's quickest) rather
  than checking Git history.
- Don't output `Searching taps...` because `Searching taps on GitHub...`
  is output by the called function (and because it'll say it's searching
  taps even when it is not if `HOMEBREW_NO_GITHUB_API` is set).
2020-10-26 12:18:07 +00:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
10e3b63b7b Inline install, reinstall and upgrade options. 2020-10-08 11:33:38 +02:00
Markus Reiter
d6b563e752 Support min_named :formula_or_cask. 2020-10-08 11:12:17 +02:00
Markus Reiter
7743fed77b Add “GLOBAL CASK OPTIONS” section to man page. 2020-10-08 11:07:35 +02:00
Markus Reiter
16d5596fbd Fix code style. 2020-10-08 11:06:04 +02:00
Markus Reiter
67519d487a Include cask in brew install help text. 2020-10-08 11:06:04 +02:00
Markus Reiter
9f40945c87 Fix installing taps in brew install.
Partially reverts f54b458cdaec5091cf7abfa3e09e9050a94a4a26.
2020-10-07 12:12:10 +02:00
Markus Reiter
08be729af0 Support all cask options in brew install. 2020-09-27 22:54:57 +02:00
Markus Reiter
f54b458cda Allow installing casks with brew install. 2020-09-27 22:53:32 +02:00
Mike McQuaid
2e5272d04c Deprecate/disable code for Homebrew 2.5.0.
Do the usual "disable deprecations" and "uncomment pending deprecations"
dance and delete/deprecate/disable relevant/related code.
2020-09-03 10:34:22 +01:00
Seeker
f366280e18 formula: add any_installed_version 2020-09-01 09:45:54 -07:00
Seeker
5def0701ba formula: rename opt_or_installed_prefix_keg to any_installed_keg 2020-09-01 09:39:20 -07:00
Seeker
ce90a534da install, livecheck: use opt_or_installed_prefix_keg 2020-08-31 10:34:56 -07:00
Mike McQuaid
dbe427073d
Merge pull request #8399 from MLH-Fellowship/migrate-to-args-named
args: Migrate usage of args loading methods to args.named
2020-08-25 10:07:27 +01:00
Markus Reiter
4937e4bbc3 Refactor and document Upgrade. 2020-08-24 19:42:24 +02:00
William Ma
fa7bd3bff6 args: Migrate usage of args loading methods to args.named 2020-08-23 09:02:20 -04: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
Bo Anderson
ab15c97c61 Fix dependents building from source when not requested 2020-08-02 00:46:17 +01:00
Markus Reiter
d4c2ffd705 Refactor CLI::Parser. 2020-07-31 15:07:17 +02:00
Markus Reiter
6b0678e8ed Remove args from FormulaInstaller. 2020-07-30 03:21:12 +02:00
Markus Reiter
05365b5542 Pass args more explicitly in FormulaInstaller. 2020-07-30 03:21:12 +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
620ca4177e Pass args to FormulaInstaller instead of using global args. 2020-07-30 03:21:12 +02:00
Markus Reiter
b3eca532fc Pass args in install 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
Markus Reiter
c0d42dd922 Remove --force from global_options. 2020-07-28 10:31:11 +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
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
Michka Popoff
6eb80c67a4 install: add backtrace on failure
The error message might be useless alone
2020-06-27 09:59:56 +02: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
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
20a1199375
Refactor CLI to remove unless args_parsed
Refactor the CLI::Args module so it doesn't have different paths to
check arguments depending on whether the arguments have been parsed or
not. Instead, set the values we need from the global ARGV at
first, global initialisation time where they will be thrown away when
the actual arguments are parsed.

To do this some other general refactoring was needed:
- more methods made private when possible
- e.g. `HEAD?` used consistently instead of `head` before arguments
  are parsed.
- formula options are only parsed after named arguments are extracted
2020-05-05 17:47:51 +01:00