57 Commits

Author SHA1 Message Date
Mike McQuaid
74d6d39e45 deps: use Formula#runtime_dependencies. 2018-03-27 14:52:48 +01:00
Mike McQuaid
592bafe24e Refactor dependencies usage
Reuse more code to avoid errors due to duplication.
2018-03-24 16:55:16 +00:00
Mike McQuaid
1dfeff7274 deps: don't display recursive test dependencies.
You only care about the test dependencies for the specific formula you
are testing right now.
2018-03-14 15:41:20 +00:00
Mike McQuaid
924c4af3de dep*: fix more :test dependency resolution. 2018-03-08 09:46:53 +00:00
Mike McQuaid
d32fc4508f deps: fix test? typo. 2018-03-08 08:36:01 +00:00
Mike McQuaid
fea9bc1e42 Allow :test dependencies.
These specify that they are needed by the test block. This can be
combined with `:build` to ensure that this formula isn't uninstalled
by `brew test-bot` when running `test do` blocks on our CI.
2018-03-05 10:36:39 +00:00
Mike McQuaid
b70b5429d0 Deprecate default_formula Requirement DSL
This has been a nightmare in terms of the complexity to our dependency
system and the whack-a-mole required on bugs. If a Requirement resolves
to a Formula it should just use `depends_on "formula"` instead. This
matches the effective behaviour all users of bottles (the vast majority
of users and installs) and what we're doing in Homebrew/homebrew-core.
2018-01-14 13:27:43 +00:00
Dominyk Tiller
c9684c3727
deps: pass explicit sort to handle APFS 2017-10-14 06:42:53 +01:00
Andrew Janke
bb85581df0 brew deps: add --include-requirements 2017-08-11 16:43:37 -04:00
Mike McQuaid
7a38bab333 Fixup all RuboCop warnings. 2017-05-29 18:43:18 +01:00
Alyssa Ross
9e97eadccb rubocop: trailing comma in multiline method calls
Discussed in
https://github.com/Homebrew/brew/pull/1987/files#r100693581.

This was originally ommitted because it wasn't compatible with Ruby 1.8.
(See https://github.com/Homebrew/legacy-homebrew/pull/48144#r49928971).
2017-02-12 15:11:38 +00:00
Andrew Janke
62d48b4f9d brew deps --tree: fix gap in line between reqs and deps 2017-01-12 16:08:41 -05:00
Andrew Janke
0097dbe4ee brew deps: support --full-name in --installed, --all, and --tree modes 2016-12-27 23:41:16 -05:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
6f3039fcd3 cmd/deps: avoid some full-name code repetition. 2016-08-30 18:49:27 +01:00
Steven Peters
7ddd3977d8 cmd/deps.rb add --full-name option
Add --full-name option to brew deps command,
which displays the full name of dependencies.
2016-08-28 00:30:30 -07:00
ilovezfs
6367508454 deps should respect skip-recommended
For example, `brew deps libass --skip-recommended` shouldn't print
harfbuzz because, even though libass builds with harfbuzz when harfbuzz
is not skipped, we asked to skip recommended, of which harfbuzz is one.

The corresponding change is made for `brew uses` as well.

Thanks to Xu Cheng for contributing the code. Any errors are mine.

Closes #129.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-06-11 01:26:28 -07:00
Martin Afanasjew
6fdcab5abc deps: split and clarify documentation
`brew deps` has three different modes of operation that were not easy to
infer from the existing documentation. Split the help text into three
parts to make this clearer. This also improves on the confusion when
options were silently ignored because they don't apply to a certain mode
of operation. Those are:

1. List the shared dependencies (either intersection or union) of
   explicitly named formulae with options for traversal depth/order.

2. Output separate trees of explicitly listed or all installed formulae.

3. List all available/installed formulae and their direct dependencies
   with one line per formula formatted as `<formula>: <dependencies>`.

Closes #137.

Closes #179.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-05-03 17:19:18 +02:00
Xu Cheng
7ba9eabc14 uses/deps: default to skip optional/build deps.
Also add options to include optional/build deps and an option
to skip recommended deps.

Closes Homebrew/legacy-homebrew#50066.
2016-04-16 21:47:47 +08:00
Max Nordlund
fa1fd70a37 Add all the top level comments 2016-04-10 22:59:25 +02:00
Alexis Hildebrandt
a9b380539c brew-deps: improved --tree formatting
Use proper BOX DRAWINGS LIGHT VERTICAL unicode character.

Closes Homebrew/homebrew#46158.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-11-19 10:20:40 +01:00
Xu Cheng
d6a50f1e76 deps: remove duplicated entires
Fixes Homebrew/homebrew#43955

Closes Homebrew/homebrew#43966.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-16 19:57:37 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Alex Dunn
d2c1a182d5 cmd/deps: --tree shows required dependencies only
Until we figure out how to allow --tree to show optional dependencies in
a way that fits on a normal screen, this helps to explain the
discrepancy between `brew deps` and `brew deps --tree`.

Closes Homebrew/homebrew#41841.
Closes Homebrew/homebrew#41947.
2015-07-21 09:44:15 -07:00
Misty De Meo
90af721152 deps: Array#keep_if isn't defined in 1.8.7
Fixes Homebrew/homebrew#41365.
2015-07-04 18:26:08 -07:00
Baptiste Fontaine
919698fdde brew deps --installed support for formulae
Closes Homebrew/homebrew#40233.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-06-03 00:35:26 +02:00
Baptiste Fontaine
9e6934d00c brew-deps: improved --tree formatting
Closes Homebrew/homebrew#40018.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-05-29 19:26:27 +02:00
Xu Cheng
06133a8ae8 deps: use Formula#full_name 2015-05-29 17:02:22 +08:00
Xu Cheng
8b57871220 uses/deps: fix for recursive deps/reqs
Closes Homebrew/homebrew#39906.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-05-20 16:29:15 +08:00
Mike McQuaid
a09641a581 deps: allow skipping build, optional deps. 2015-03-23 13:30:54 +00:00
Jack Nagel
10a1952d2c Only "extend self" once on the Homebrew module 2014-06-19 13:10:36 -05:00
tduehr
c101919a2e Add brew deps --union
The default behavior of `brew deps foo bar` is to return the
intersection of the deps of foo and bar. This option returns the union.

Closes Homebrew/homebrew#27480.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-05-06 21:06:23 -05:00
Jack Nagel
4002abb146 deps: use Dependency objects in recursive_deps_tree 2014-02-27 12:56:59 -06:00
Jack Nagel
87cbe716d9 deps: keep "--all" output sorted 2014-02-27 12:56:42 -06:00
Jack Nagel
aafae73cf9 Fix regression in brew deps
The default mode is intended to display recursive dependencies, with the
`--1` flag to display only one level.
2013-11-02 22:22:45 -05:00
Mike McQuaid
d6ffd493a6 deps: don't use symbol-like output by default. 2013-10-30 13:13:41 -07:00
Mike McQuaid
34d836872f deps: display requirements default_formulae. 2013-10-30 10:48:53 -07:00
Adam Vandenberg
ae9401291d fix deps
Closes Homebrew/homebrew#21113.
2013-07-10 06:59:45 -07:00
Jack Nagel
2356a6d874 deps: allow "--installed --tree" 2013-06-22 12:54:46 -05:00
Jack Nagel
a02d5f33b4 deps: use OpenStruct to capture the mode 2013-06-22 12:54:46 -05:00
Jack Nagel
c2faf2a0ca deps: remove need for Array extension 2013-06-22 12:54:45 -05:00
Jack Nagel
6790f6adb0 deps: extract output methods 2013-06-22 12:54:45 -05:00
Jack Nagel
d28deee516 deps: move recursive_deps_tree into Homebrew module 2013-06-09 12:59:42 -05:00
Jack Nagel
2517969585 deps: fix --1 output
Fixes Homebrew/homebrew#17550.
Closes Homebrew/homebrew#19668.
2013-05-10 23:45:30 -05:00
Jaime Marquínez Ferrándiz
adbd8cee6d New visualization for brew deps --tree
Closes Homebrew/homebrew#18835.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-04-13 20:32:45 -05:00
Matt Torok
5f2f6a35dd Added '--installed' option to deps command.
When deps command is passed this option, it will only show the dependencies
for the installed forumas. This option overrides the '--all' option.

Closes Homebrew/homebrew#18276.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-03-05 19:43:12 -08:00
Jack Nagel
109145bf21 Replace usages of recursive_deps with recursive_dependencies 2013-01-26 12:14:49 -06:00
Jack Nagel
e629f14d56 Remove <=> from Dependency interface
It is important that dep equality corresponds to the name attribute, but
we may want to use the Comparable interface to sort them by installation
order in the future. Code that needs to sort them alphabetically should
just use sort_by.
2013-01-13 21:01:15 -06:00
Jack Nagel
801d8b2bfd deps: fix --tree for new deps
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-11 18:24:46 -05:00