898 Commits

Author SHA1 Message Date
Bo Anderson
a2939be08a formula_installer: don't propagate --include-test unless requested 2020-05-19 19:12:47 +01:00
Mike McQuaid
8b98ed1f47
Further tweak :test dependency handling
- ensure that cases where `:build` and `:test` both apply to a
  dependency that we handle it appropriately
- fix reintroduced regression
  (https://github.com/Homebrew/brew/pull/6471#issuecomment-533414923).
  Fixes #6470.
2020-05-19 14:25:10 +01:00
Mike McQuaid
2fc643421f
formula_installer: fix test dependencies.
Only prune test dependencies from the tree when they aren't also build
dependencies (and vice-versa with build dependencies) and the include
test argument hasn't been passed.
2020-05-19 09:34:50 +01:00
Mike McQuaid
3588e6a5c6
bottle_arch: ensure a symbol is used when needed.
Fixes #7597.
2020-05-19 08:47:59 +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
b9f493a7f6
Pass FormulaInstaller#display_options to BuildError.
This should improve the output in analytics.
2020-05-18 12:46:25 +01:00
Mike McQuaid
10c9d96566
Merge pull request #7552 from MikeMcQuaid/fetch-resources-from-source
Fetch (all) resources when building from source
2020-05-12 14:27:52 +01:00
Mike McQuaid
6ed1ccd8e8
Fetch (all) resources when building from source
Also:
- when `brew test` or `brew postinstall` is run allow `Resource#stage`
  to fetch the resource.
- make `Formula#fetch` and `Resource#fetch` fetch external patches too.

Follow-up from #7549 and #7546.
2020-05-12 12:37:54 +01:00
Mike McQuaid
a333014c55
formula_installer: ignore dependencies when fetching.
Whenever you are fetching a dependency you only care about fetching that
specific dependency and not all the dependencies of that dependency.

Unlike installing, dependencies can be fetched in any order and have no
"chains" between them.
2020-05-12 10:45:10 +01:00
Mike McQuaid
12bdb38663
rubocop: brew style --fix autocorrections. 2020-05-12 08:32:27 +01:00
Mike McQuaid
48918bb5e3
formula_installer: add fetch_dependency method.
This uses `FormulaInstaller#fetch` to recursively fetch dependencies
through the dependency tree and allows `install_dependency` to not
do any fetching.
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
1c656fb584
Merge pull request #7538 from MikeMcQuaid/bottle_arch
Replace ARGV#bottle_arch with Homebrew.args.bottle_arch
2020-05-11 08:46:57 +01:00
Mike McQuaid
5f721c6986
Cleanup ARGV.include? usage
Remove usage where `Homebrew.args` could be used instead or, due to the
`Homebrew.args` parsing, there was dead code that was never executed
(and no-one complained about not working).
2020-05-10 15:28:31 +01:00
Mike McQuaid
07b19cba09
Replace ARGV#bottle_arch with Homebrew.args.bottle_arch
Part of https://github.com/Homebrew/brew/issues/5730
2020-05-10 15:15:41 +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
Gautham G
b40e33aeb8 ARGV: Deprecate ARGV.cc and replace with Homebrew.args.cc 2020-05-04 11:14:55 +05:30
Mike McQuaid
b2571d42eb
Merge pull request #7484 from MikeMcQuaid/cleanup-sandbox
Cleanup Sandbox code
2020-05-02 14:16:09 +01:00
Mike McQuaid
40ec8e69cc
Cleanup Sandbox code
Remove unused code and methods.
2020-05-02 13:45:04 +01:00
Gautham G
f6abc6fe19 ARGV: Deprecate ARGV.formulae, replace with Homebrew.args.formulae 2020-05-01 22:50:59 +05:30
Mike McQuaid
b3a7ad7ca6
formula_installer: fix build_from_source? call.
This should check the local instance variable rather than the global
value as it varies for dependencies and requested formulae.
2020-04-21 13:26:37 +01:00
Gautham G
676ebf7419
ARGV: Deprecate ARGV.force_bottle? 2020-04-20 16:45:43 +01:00
Gautham G
2bdbca1280 Revert "Merge pull request #7289 from Homebrew/revert-7279-argv-cleanup-18"
This reverts commit 64fd839c955b3c32855067d26fed7daf65183877, reversing
changes made to 6f50801b37b7d829afc37da76d2ef0a1ac1c9f5f.
2020-04-11 18:50:24 +05:30
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Gautham Goli
ad7e1d48a5
Revert "ARGV: Deprecate ARGV.build_formula_from_source? and ARGV.build_from_source?" 2020-04-05 23:01:57 +05:30
Gautham G
602cb7e636 ARGV: Deprecate ARGV.build_formula_from_source? and ARGV.build_from_source? 2020-04-05 16:47:47 +05:30
Mike McQuaid
3effcc4dff
Tweak formula deprecation/disabling. 2020-04-01 13:42:52 +01:00
Gautham G
7ad6dab288 ARGV: Deprecate ARGV.collect_build_args 2020-03-28 21:00:59 +05:30
Steven Peters
096a5bdfb4 FormulaInstaller: link tmp kegs during rescue
In #6807, the FormulaInstaller began to rescue from
FormulaInstallationAlreadyAttemptedError but there is the
potential for tmp kegs to remain unlinked in the cellar.
I've merged the rescue statements so they both re-link tmp
kegs, but it doesn't raise for
FormulaInstallationAlreadyAttemptedError.
2020-03-21 14:25:35 -07:00
Gautham G
badcaa15e4
ARGV: Deprecate ARGV.keep_tmp? 2020-03-15 13:24:48 +00:00
Gautham G
1292c4559c ARGV: Deprecate ARGV.interactive? 2020-03-15 16:28:04 +05:30
Mike McQuaid
020d6e2843
upgrade: suggest full_name when appropriate.
Otherwise `brew install foo/bar/baz` when an older version of `baz` is
installed will tell you to run `brew upgrade baz` which won't work.
2020-03-11 17:06:42 +00:00
Mike McQuaid
b5165ed7e8
Clarify tap issues should not be reported to Homebrew.
Instead, direct people to the actual tap.
2020-03-11 10:57:36 +00:00
Mike McQuaid
ecce70bc32
Rename --quieter args to --quiet. 2020-02-05 19:43:59 +00:00
Gautham Goli
1f9563f4bc ARGV: Deprecate ARGV.quieter? 2020-02-04 18:53:33 +02:00
Gautham Goli
acde828a45 ARGV: Replace ARGV.verbose? with Homebrew.args.verbose? 2020-02-02 14:00:04 +01:00
Gautham Goli
de9295cc7a
Merge pull request #6939 from Homebrew/argv-cleanup-8
ARGV: Replaces usages of ARGV.force? with Homebrew.args.force?
2020-01-15 21:25:36 +05:30
Gautham Goli
161c3fb6a4 ARGV: Replaces usages of ARGV.force? with Homebrew.args.force? 2020-01-15 21:09:31 +05:30
Gautham Goli
073685284f postinstall: Use CLI::Parser to parse args 2019-12-28 14:48:34 +05:30
Steven Peters
13e34ec90d
FormulaInstaller: rescue already attempted install 2019-12-04 09:08:22 +00:00
Mike McQuaid
5dd8ead51a
Rename Formula#installed? to Formula#latest_version_installed?
This naming has always been a bit weird and confusing so let's change
it and provide a `compat` fallback for later deprecation.
2019-12-03 11:42:42 +00:00
Bo Anderson
b4f8671849 formula_installer: copy hidden files into bottles. 2019-11-07 14:47:15 +00:00
Mike McQuaid
ddcbdbe0c0
formula: cache runtime_dependencies related stuff. 2019-11-06 10:04:13 +00:00
Mike McQuaid
eeb9ac36a2
keg: cache runtime_dependencies. 2019-11-06 10:04:13 +00:00
Markus Reiter
6c03cc0040 Fix RuboCop namespace. 2019-10-21 20:09:56 +02:00
Mike McQuaid
cbf458ea9c
Lint/ElseAlignment: ignore some bugged autocorrections. 2019-10-14 09:03:02 +01:00
Issy Long
489ba3f462
Auto-fix Layout/ClosingHeredocIndentation offenses 2019-10-13 16:04:32 +01:00
Issy Long
00adbbe98f
Auto-fix Layout/IndentHeredoc offenses 2019-10-13 16:04:31 +01:00
Issy Long
e5e28fbd69
Auto-fix more Layout/IndentationWidth offenses
- These didn't appear in the first pass as the other offense fixes caused them.
2019-10-13 16:04:30 +01:00
Issy Long
245c61017f
Auto-fix Layout/ElseAlignment offenses 2019-10-13 16:04:28 +01:00