52 Commits

Author SHA1 Message Date
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
ff7294ee1f uses: use Formula#runtime_dependencies. 2018-03-27 14:52:47 +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
e50c40b9c6 uses: add --include-test support. 2018-03-16 09:29:31 +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
60eb7c6216
uses: pass explicit sort to handle APFS 2017-10-14 04:17:48 +01:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Mike McQuaid
7a38bab333 Fixup all RuboCop warnings. 2017-05-29 18:43:18 +01:00
Mike McQuaid
5a2c91dbc2 uses: allow checking deleted formulae.
This is useful for seeing when formulae are deleted if they are going to
leave behind any formulae that depend on them.

As a result, if there are any formulae returned return a non-zero/failed
exit status.
2017-04-17 15:06:48 +01:00
EricFromCanada
afc539f86e Update brew's man page formatting and grammar
Also update command specifications to match descriptions.
2017-02-25 17:37:57 -05:00
Mike McQuaid
ffa5ebde53 Merge pull request #1863 from alyssais/uses_ignore_untapped
uses: properly handle untapped formulae in recursive dependency expansion (again!)
2017-01-17 19:58:52 +00:00
Alyssa Ross
9475622c07 uses: restore formula-level exception handler
This is a temporary measure until:

- #1862 is merged
- I can a test on `brew uses` against every formula in the official
  taps to verify that exceptions are no longer raised.
2017-01-16 23:28:26 +00:00
Alyssa Ross
0b216798bb Revert "Revert "uses: properly handle untapped fo…
…rmulae in recursive dependency expansion""

This reverts commit dc9819b86c60b5c6fd10373ff318d8ef60f97d52.
2017-01-16 23:28:26 +00:00
Alyssa Ross
36c1c8e9b0 uses: fix recursive requirement resolution
Fixes #1848 by sharing recursive dependency resolution between
dependencies and requirements.

Coincidentally, this also fixes the errors introduced by #1784 that
necessitated it being reverted in #1797.
2017-01-16 23:04:26 +00:00
Mike McQuaid
dc9819b86c Revert "uses: properly handle untapped formulae in recursive dependency expansion" 2017-01-07 13:15:18 +00:00
Alyssa Ross
536b6e2396 uses: properly handle recursive deps exceptions
Fixes #1776.

If any known formula had a dependency on an untapped tap,
Formula#recursive_dependencies would throw an exception, which would be
caught by the outer exception handler, causing the rest of the
dependencies for that formula to be skipped and incomplete output to be
generated.

To fix this, I added a check to avoid analysing the dependencies of
formulae from uninstalled taps.

Additionally, I removed the aforementioned outer exception handler added
in 5fdb89aed90f03413cdb21af430411c4a722876e, because the only other
place that should be capable of throwing such an exception is the
statement that was surrounded by another wider exception handler in
Homebrew/legacy-homebrew#40682.
2017-01-05 00:33:44 +00:00
Markus Reiter
198bf4d3bd Convert puts_columns to puts Formatter.columns. 2016-10-15 17:13:38 +02:00
Markus Reiter
01d87f8107 Don’t use puts_columns if empty? or single item. 2016-10-15 17:13:38 +02:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Mike McQuaid
1174264d47 cmd/uses: fix Rubocop warnings. 2016-09-11 17:59:01 +01: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
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
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
Xu Cheng
3ded175241 uses: rescue TapFormulaAmbiguityError caused by Dependency#to_formula
Fixes Homebrew/homebrew#40636.
2015-06-15 12:55:47 +08:00
Xu Cheng
c6e1090c43 requirement: allow access default_formula directly 2015-06-07 20:32:45 +08:00
Xu Cheng
932afdd9be uses: use Formula#full_name 2015-05-29 17:02:23 +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
Xu Cheng
cacad69a8e uses: make skip arguments work for requirement 2015-05-20 16:29:15 +08:00
Mike McQuaid
62df28a476 uses: also check the default formulae.
This means e.g. `elixir` will show up as using `erlang`.
2015-04-08 13:39:12 +01:00
Mike McQuaid
80714aaa7c uses: remove unused variable. 2015-03-08 09:39:15 +00:00
Xu Cheng
f640cbac9e brew uses: parse ARGV properly
`ARGV.flag?` = `ARGV.include?` + `ARGV.switch?`

Closes Homebrew/homebrew#36727.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-02-11 11:02:46 +00:00
Xu Cheng
105eaf3382 test-bot: only test the runtime dependencies.
Also add support to `brew uses` to ignore build or optional dependencies.

Closes Homebrew/homebrew#36154.
Closes Homebrew/homebrew#36656.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-02-09 14:12:19 +00:00
Mike McQuaid
5fdb89aed9 uses: harden against missing formulae. 2014-12-27 13:03:13 +00:00
Kevin Sjöberg
73ff739583 Convert dependencies to formulas for name matching
Dependency names are prefixed with the tap location, therefore
dependency names do not match formula names. We convert dependencies
into formulas to ensure proper name checking.

Closes Homebrew/homebrew#35058.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-12-23 14:08:40 -05:00
Jack Nagel
10a1952d2c Only "extend self" once on the Homebrew module 2014-06-19 13:10:36 -05:00
Jack Nagel
872f46dc1e Restore documented behavior of brew uses foo bar
`brew uses foo bar` is supposed to return the intersection of formulae
that use foo and bar. However, this was broken by changes made to
support requirements that can coerce to regular dependencies.
2014-04-07 13:07:04 -05:00
Jack Nagel
574fc99258 uses: only check ARGV for recursive flag once 2014-04-07 13:07:04 -05:00
Jaime Marquínez Ferrándiz
342ed1d163 uses: fix --installed with outdated versions
With that option iterate only over `Formula.installed`, otherwise
iterate over `Formula`. This is faster than iterating over all the
formulae and checking if it's installed.

Fixes Homebrew/homebrew#27259.
Closes Homebrew/homebrew#27295.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-03-07 18:47:34 -06:00
Mike McQuaid
55db2f7e11 uses: fix weird colon output.
Closes Homebrew/homebrew#24145.
2013-12-12 21:24:42 +00:00
Mike McQuaid
868b4f8bea uses: display requirements.
Closes Homebrew/homebrew#23758.
2013-10-30 10:48:53 -07:00
Adam Vandenberg
dbc1df51f4 Reword uses comment 2013-06-26 11:33:31 -07:00
Jack Nagel
c8ae97dde8 uses: fail fast if invalid formula names are given
Fixes Homebrew/homebrew#20819.
2013-06-26 12:59:46 -05:00
Jack Nagel
18836d93d8 uses: utilize modern dependency API 2013-01-26 12:14:49 -06:00
Chad Catlett
2a4a3c3a95 Fix uses cmd
Fixes Homebrew/homebrew#17074.
Closes Homebrew/homebrew#17075.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-14 06:44:53 -08:00
Max Howell
9274f7cda1 Formula.Enumerable
Deprecated Formula.all, replaced usage with more appropriate enumerable options. Just check out how much nicer `brew audit` runs now.
2012-08-21 12:09:05 -04:00
Adam Vandenberg
5141c9cadd Add brew uses --recursive
Closes Homebrew/homebrew#8870.
2012-03-16 22:00:59 -07:00
Jack Nagel
1a3a1249bf Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-04 00:27:05 -06:00
Adam Vandenberg
7ed76725c4 uses: do nothing if no args 2012-02-03 21:40:15 -08:00
Charlie Sharpsteen
9898956047 uses.rb: Pass a block to map instead of a Proc
Passing a `Proc` doesn't work in Ruby 1.8.6 which causes `brew uses` to fail on
Leopard.
2011-11-28 23:29:29 -08:00