477 Commits

Author SHA1 Message Date
Max Howell
62ef92b837 If Xcode isn't installed, raise
We were raising but in a completely misleading and unintended fashion.
2009-12-30 20:52:06 +00:00
Alexander Solovyov
650d1cb165 brew: add 'cat' command 2009-12-22 05:49:31 +00:00
Adam Vandenberg
70176cb0ec Another git command. 2009-12-12 16:24:15 +00:00
Adam Vandenberg
8443c9be7d Some small style reformats 2009-12-12 16:24:15 +00:00
Max Howell
635cb27d13 Unlink before uninstalling
Nice bug there where we never removed any symlinks, because the unlink step requires the keg to be full of files to determine what symlinks to remove.
2009-12-12 16:23:03 +00:00
Max Howell
4254661c66 Brew update will git init if required
This is necessary for those who installed Homebrew using the suggested tarball method.

Too late for them though.
2009-12-07 18:20:04 +00:00
Max Howell
54aff61ef6 Prompt user to use pip for Hg and Bzr 2009-12-05 17:29:49 +00:00
Max Howell
bf07b9662a Puts URL for failed build line 2009-12-04 10:36:25 +00:00
Max Howell
b70367fa96 cd HOMEBREW_REPOSITORY before trying to git info it 2009-12-02 13:07:20 +00:00
Max Howell
dd0df9bd37 Show exit status properly
Turns out $?.to_i is a 16bit int with some bit flags in the first byte.
2009-12-02 13:07:03 +00:00
Max Howell
c76e0156d7 We don't need the whole backtrace for BuildErrors 2009-12-02 12:31:44 +00:00
Max Howell
1dc9df13fb We can't rely on the $: order
Some gems and libraries seem to change the order.
2009-12-01 12:07:34 +00:00
Max Howell
9294e19859 brew --config output improved if no GCC 2009-12-01 12:07:34 +00:00
Adam Vandenberg
411874e0b6 Add command 'brew info --all'. 2009-11-19 14:03:08 -08:00
Adam Vandenberg
7366a41268 New command 'brew deps [formula]'
Where brew info will show the next-level-down dependencies, brew deps
will show all of the formulae that a given formula depends on.
2009-11-19 14:03:07 -08:00
Adam Vandenberg
95e398ab13 Add alias support to formulae
* brew install will find an aliased formula
* aliases are searched against
* warn when creating a new formula that has an existing alias.

If Subversion has an alias "svn", then warn when the user tries to
create a new formula "svn". The formula can still be created, though
the user should make sure it's not a duplicate of the existing
aliased one.

Subversion and Objective-Caml formulas get some alises here, so we have
something to test against.
2009-11-19 14:03:07 -08:00
Adam Vandenberg
af29299f37 Add brew command 'uses'
'uses' shows the formulas that depend on a formula given on the
command-line.
2009-11-19 14:03:07 -08:00
Adam Vandenberg
59a686e3c2 Add extra message for unknown commands that are git commands. 2009-11-19 14:03:07 -08:00
Adam Vandenberg
be412369ae Also allow 'brew help'. 2009-11-19 14:03:07 -08:00
Adam Vandenberg
34c213097e Fix when 'edit' if/else indentation 2009-11-19 14:03:06 -08:00
Adam Vandenberg
4fbcf13e65 Move some helper functions into Hardware 2009-11-19 14:03:06 -08:00
Max Howell
00e227ac46 More tweaking of main exception handler output 2009-11-12 01:37:02 +00:00
Max Howell
6488212a54 Show kernel architecture in brew --config output 2009-11-11 21:51:44 +00:00
Max Howell
627034c441 Re-raise SystemExit so the correct exit code is set
The reason we rescue this exception at all is because otherwise our general purpose Exception handler catches it.
2009-11-11 18:56:37 +00:00
Adam Vandenberg
5e915653d7 Be specific about 3.1 point release. 2009-11-11 10:49:01 -08:00
Max Howell
fffa3eb22f dump_config for certain exceptions
Ideally we could do a get request and fill in the issue form at GitHub. Presumably though, we'd only do this if the user typed brew report or somesuch.

Someone should get that implemented!
2009-11-11 18:43:03 +00:00
Max Howell
a0b89fe9a3 Include macports or fink info with brew --config 2009-11-11 18:43:02 +00:00
Max Howell
450845889b Include HEAD SHA with brew --config 2009-11-11 18:37:13 +00:00
Max Howell
8e3f846911 My idea of tidy, sorry Adam… 2009-11-09 18:48:05 +00:00
Max Howell
b99324fbeb DRY gcc_build and llvm_build 2009-11-09 18:47:26 +00:00
Adam Vandenberg
20d7ef3d45 Add OS X, Ruby, compiler & hardware info to --config 2009-11-09 18:35:39 +00:00
Max Howell
bc364655fc Don't error out before Cellar is created
We need a test for this.
2009-11-08 16:23:08 +00:00
Max Howell
c35887b6f3 Warn users about Xcode versions that are too old
Closes Homebrew/homebrew#116
2009-11-08 16:22:15 +00:00
Max Howell
96d790edc1 Simplify the library path determination code a little 2009-11-08 15:21:15 +00:00
Max Howell
86516e563f Set ENV[HOMEBREW_BREW_FILE]
Thus install.rb gets the path to the instantiating brew process rather than whichever is first in the PATH. Not to mention Homebrew doesn't *have* to be in the PATH.
2009-11-08 15:21:14 +00:00
Max Howell
6b18d5572d Rename BREW_FILE HOMEBREW_BREW_FILE
Because it's a global.h constant and that file can be included by other projects.
2009-11-08 15:21:14 +00:00
Max Howell
4266d6c1c7 Ensure BREW_FILE is an absolute path
It's a constant and Dir.getwd can change.
2009-11-08 15:21:14 +00:00
Max Howell
1e879eaee8 Propagate exit status in ExecutioError exception 2009-11-07 18:22:36 +00:00
Max Howell
fba0a5c5cd brew edit works if the file in question won't parse 2009-11-07 18:22:36 +00:00
Max Howell
6386ce4df5 Provide system info for build errors 2009-11-07 18:22:34 +00:00
Max Howell
c5eb65332d Don't require hardware.rb globally 2009-11-07 18:22:33 +00:00
Max Howell
173f5f4a87 Fixed SIGINT handling, so we can have our newline
We trap the INT in the install process now so the newline race condition is avoided. Much neater and more polished now.
2009-11-07 18:22:33 +00:00
Max Howell
e587c68a2a Better error for unknown brew commands 2009-11-07 18:22:33 +00:00
Max Howell
3d89578b5c Use HOMEBREW_REPOSITORY for brew log 2009-11-07 18:22:33 +00:00
Max Howell
8081a95c4a Better errors if missing keg or formula arguments 2009-11-07 18:22:33 +00:00
Max Howell
03ca3e24d0 Don't throw if named.empty?
Generally this isn't desired or useful.
2009-11-07 18:22:33 +00:00
Max Howell
794a55a72b brew install improvements
Couldn't make this atomic, apologies.

Fixes a few things, like deps failing to build not aborting the install.
--force now works properly again.

Overall more robust code. I went back over it all and gave it a lot of
thought.

Cleaner separation of logic. Less code in brew, now the only code there is
ARGV handling, and basic sanity checks.

Not extending ARGV or ENV in global now as that would propagate to other tools
or utilities you may write.
2009-11-07 18:22:28 +00:00
Max Howell
e046e1e640 More useful Macports/Fink detection function 2009-11-04 16:27:37 +00:00
Max Howell
adf8d30a92 Faster uninstall
Only unlink the keg, don't prune. That's enough, we shouldn't do general maintenance anyway.
2009-11-04 16:27:37 +00:00
Adam Vandenberg
3087888fb0 Rewrite of HOMEBREW_ folder locations
This rewrite attempts to sort out where the Prefix, Cellar, and
Repository are relative to the real and symlinked 'brew' command.

Also included is a --config option which dumps all of these variables.

Any top-level script must define a "BREW_FILE" that gives the path
to brew as it exists in the path. 'brew' itself just uses __FILE__ and
install.rb does a `which brew` (there may be a better way?)

The Prefix is always relative to the location of brew as it exists in
the path. Thus, whether or not /usr/local/bin/brew is a symlink or real
file, the Prefix is always /usr/local. If you have brew in some other
prefix, such as /nonstandard/bin/brew, then '/nonstandard/ will be
managed by brew instead.

The Repository, Cellar, and "Library/Homebrew" required code is always
found relative to the "real" path or brew. If brew is a real file in
/usr/local/bin/brew, then everything else will be found in /usr/local
and we'll expect a /usr/local/.git

Otherwise, we dereference brew's symlink and look for everything else
relative to that path instead.
2009-11-04 16:27:34 +00:00