72 Commits

Author SHA1 Message Date
Jack Nagel
951620f146 Restore ARGV even if an exception is raised 2013-01-10 15:57:21 -06:00
Mike McQuaid
f25e7de43b Add --homebrew-developer flag 2013-01-01 16:39:06 +00:00
Mike McQuaid
4b0e663c2c Improve bottle error messages.
On installation or creation of a bottle error out of the current
machine does not support bottles.

References Homebrew/homebrew#16291.
2012-12-04 12:06:02 +00:00
Jack Nagel
96844850b4 Return the block value in ARGV.filter_for_dependencies
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-24 17:54:16 -05:00
Mike McQuaid
b30454d3be Don't use bottles for HEAD, devel or universal. 2012-09-30 22:26:33 +01:00
Mike McQuaid
55dc5466fb Fix building bottles from source. 2012-09-18 20:05:03 +01:00
Misty De Meo
ee4c696380 ARGV: add .json
Used by brew info; may be used by other commands in the future.
2012-09-17 19:06:40 -05:00
Mike McQuaid
67f78074f9 Miscellaneous bottle code cleanup. 2012-08-25 13:08:46 -07:00
Mike McQuaid
d5b954ebd4 Fix ARGV and bottles circular dependency. 2012-08-25 11:52:37 -07:00
Mike McQuaid
ebbc3438a1 Move used_options and unused_options to ARGV. 2012-08-25 11:52:37 -07:00
Max Howell
abf55c2bcd Support ENV[VERBOSE] 2012-08-21 12:09:07 -04:00
Jack Nagel
8a21bd52d5 Add ARGV.ignore_deps?
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 19:33:39 -05:00
Max Howell
33ec48a394 Don't require the WHOLE of Homebrew from ARGV.rb
This was slowing down every instantiation of brew significantly.

Hopefully doesn't break anything that had become accustomed to not having to require 'formula' or 'keg'.

/cc @mikemcquaid
2012-08-12 11:40:55 -04:00
Misty De Meo
f17429f842 ARGV: add .dry_run? method
Add an ARGV.dry_run? helper method for '--dry-run'/'-n' now that
'-n' is being used as a git-style dry-run in two commands.

Closes Homebrew/homebrew#12898.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-07-09 12:01:09 -05:00
Adam Vandenberg
0c14036a9a Add ARGV.build_stable? 2012-06-10 14:49:56 -07:00
Jack Nagel
9d172f85c6 ARGV: use include? for --HEAD
ARGV.build_head? will return true if the typo '-HEAD' is passed because
it uses flag? to detect the option. However, we only filter the exact
spelling of '--HEAD' in ARGV.filter_for_dependencies, and thus the HEAD
property is undesirably passed to deps during installation.

Since we never advertised '-H' as a valid short option for '--HEAD',
just use include? instead of flag?.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-10 21:53:01 -05:00
Max Howell
d145fd30b4 Be more helpful about how to resolve this issue 2012-03-19 14:19:56 +00:00
Max Howell
9ab1df5b68 If no formula but multiple kegs, advise resolution
In this case the user will simply have to delete all but one keg in order to use the command that uses ARGV.kegs.

Refs Homebrew/homebrew#11050.
2012-03-19 14:17:50 +00:00
Mike McQuaid
b86ead91ea Revert "Always build bottles universally."
This reverts commit 72a477f2734939d4c5805247588c4cdea69b5383.
2012-03-10 19:28:46 +13:00
Mike McQuaid
6d940a5bcc Always build bottles universally. 2012-03-10 18:11:12 +13:00
Mike McQuaid
552dcdc703 Move most bottle stuff to a bottles.rb file. 2012-03-10 18:10:40 +13:00
Max Howell
735b6337a1 If multiple kegs, default to formula keg
If it exists, ARGV.kegs will return the Formula.prefix keg for each rack examined.

So for ARGV=[wget, foo] and the following Cellar (wget/1.11, wget/1.12, foo/1.0) you'll get [wget/1.12, foo/1.0] from ARGV.kegs provided 1.12 is the formula version of wget.
2012-03-07 12:33:47 +00:00
Max Howell
b63ec18564 Proper single character switch handling
Includes a test. So now you can do `brew cleanup -ns` and it will work.
2012-03-06 20:28:06 +00:00
Max Howell
6868bf0d6e Don't require formula files for brew rm --force
In fixing this I also made it so that ARGV.kegs will return the LinkedKeg if the symlink is set. Which is almost always is. This neatly avoids most multiple-kegs issues.

Fixes Homebrew/homebrew#10685.
2012-03-06 13:47:31 +00:00
Adam Vandenberg
95f1d330b2 don't complain if args are empty 2012-02-03 21:40:14 -08:00
Mike McQuaid
a3db9a42e8 Add option for building bottles.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2012-01-16 21:05:00 +00:00
Adam Vandenberg
28a00a2c09 Standardize 32 bit build switch 2012-01-02 14:53:36 -08:00
Charlie Sharpsteen
3cd9b6db6a Fix array concatenation in ARGV.filter_for_dependencies
Gah. This was supposed to be in the last commit, but I forgot to `--amend` it.
2011-11-27 14:44:39 -08:00
Charlie Sharpsteen
00659f0f39 Don't suppress --verbose while installing deps
Unless the `--quieter` flag is passed.

Closes Homebrew/homebrew#8723.
2011-11-27 14:37:31 -08:00
Charlie Sharpsteen
edde8d75c7 Suppress --devel while installing dependencies
Unless the dependency is explicitly passed to `brew install --devel`.
2011-11-27 14:37:31 -08:00
Charlie Sharpsteen
b5f942764a Re-work ARGV filtering to properly handle --HEAD
Previously, stripping arguments like `--HEAD` for dependencies failed because
that flag affects the installation prefix encoded into formula objects. The
previous implementation of `ARGV` filtering tried to contain all changes to a
single method call before the `FormulaInstaller` forks. This update spreads
things out a bit:

  - The Homebrew `ARGV` extension adds a new method, `filter_for_dependencies`
    which strips flags like `--HEAD`, yields to a block, then restores the
    original contents of ARGV.

  - The `explicitly_requested?` test, which returns true or false depending on
    if a formula object is a member of `ARGV.formulae`, is now a method of
    `Formula` objects.

  - `FormulaInstaller` objects now execute the installation of dependencies
    inside an `ARGV.filter_for_dependencies` block if the dependency was
    `explicitly_requested?`.

Fixes Homebrew/homebrew#8668.
Closes Homebrew/homebrew#7724.
2011-11-27 14:37:31 -08:00
Jack Nagel
b62bd90a1d Define and use ARGV.build_devel?
Often it is useful to provide a development build in addition to the
stable release or HEAD download.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-11-21 20:04:33 -08:00
Justin Hileman
8f3a74993b Allow 'brew link' to work with URL-based formulae
Closes Homebrew/homebrew#7373.

Signed-off-by: Max Howell <max@methylblue.com>

I added some comments.
2011-09-02 12:12:30 +01:00
Mike McQuaid
9289c06299 Don't install bottles in non-default HOMEBREW_PREFIX. 2011-07-31 11:47:14 +01:00
Mike McQuaid
81c7ec9933 Build from source (for now) unless on Lion.
Longer-term we'll try and use install_name_tool to fix Lion
bottles so they run fine on 10.5 and/or 10.6.

Closes Homebrew/homebrew#6699.
2011-07-29 18:36:47 +01:00
Mike McQuaid
2495cdc544 Build from source when we've options or 10.5. 2011-06-22 17:48:20 +01:00
Mike McQuaid
b7dd6f1f7e Remove redeclared method. 2011-06-21 19:25:39 +01:00
Mike McQuaid
31dea3b800 Add changes to Homebrew internals for bottling. 2011-06-08 22:19:10 +01:00
Jack Nagel
4e65175564 Fix misspelled method name: Formula.canonical_name
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-05-07 21:50:37 -07:00
Adam Vandenberg
4dbb08a6d8 Add ARGV.build_universal? 2011-04-23 08:36:38 -07:00
Max Howell
ec9cbc6466 Optimise/simplify brew help
Be more useful by being more concise. I referenced dozens of other mature commands’ usage to figure out what to do here.

Also separated out the help into its own command for consistency.
2011-03-13 12:54:30 +00:00
Adam Vandenberg
2a5f757816 Use + instead of /. 2011-03-12 11:55:07 -08:00
Max Howell
e96744eb6f brew deps foo bar now gives the dependency intersection
Rationale: this is more useful than the union, and you can still easily get the union by running the command twice and concatenating the result.
2011-03-12 11:55:04 -08:00
Max Howell
55bd25ff4c Formula.resolve_alias to compatability.rb 2011-03-12 11:55:03 -08:00
Max Howell
c1a3b724fd Some Cleanup 2011-03-12 11:55:03 -08:00
Adam Vandenberg
0225f07eba Move some exceptions 2011-03-12 11:55:03 -08:00
Lee Packham
883fd9ef89 Correct the principle usage of principal principles ;)
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2010-11-21 13:20:12 +00:00
Adam Vandenberg
ea03121688 Allow installation from URLs
This allows installation like:
    brew install http://example.com/something.rb

Based on an original patch by [dwalters].

Fixes Homebrew/homebrew#160
2010-10-30 14:23:01 -07:00
Adam Vandenberg
560408d01b Use classes instead of strings for exceptions 2010-10-17 17:21:21 -07:00
Adam Vandenberg
bb01afce4c Move resolve_alias from ARGV to Formula
Also, call this function from a few places where the code was duplicated.
2010-09-29 21:55:44 -07:00