305 Commits

Author SHA1 Message Date
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
Max Howell
ffe4f25d87 Marshal install.rb exceptions back to the parent process
Using an error pipe.

The use of ENV[HOMEBREW_ERROR_PIPE] feels wrong, but I wasn't sure how else to
proxy the file descriptor to the child process since the fork immediately
calls exec.
2009-10-24 16:20:58 +01:00
Max Howell
5599316971 Don't look broken if CWD doesn't exist
Ruby throws if CWD doesn't exist, even when you aren't doing anything related to the CWD. Sucks. So at least show the user a friendly error message rather than looking broken.
2009-10-23 19:20:12 +01:00
Max Howell
06e16bff7d Remove check for gcc
Since plenty of formula don't require it, I don't want to insist on gcc being installed. A better check is if gcc is required then check for version 4.2, which is all we support.

However I can't easily do that. So I'm risking bug reports from people who didn't read the installation instructions and didn't install the right Xcode. But they deserver derision :P
2009-10-15 16:51:59 +01:00
Max Howell
c8d6ee46c5 Only create named arguments 2009-10-15 16:51:59 +01:00
Max Howell
af088a8a33 Handle certain ARGV parameters before certain error checks 2009-10-15 16:51:58 +01:00
Max Howell
543a113712 Some subdirs and renames to aid homebrew n00bs
The classes better reflect their contents. I'm sure this change may be
contentious, but I am a sucker for trying to create source bases that are easy
to get to grips with and easy to navigate.

brewkit.rb is now a deprecated file.
2009-10-15 16:51:53 +01:00
Max Howell
73d0ee4358 Move verbose ARGV display to install.rb
This works better as it comes after any keg-only deps change ENV, but also it needs to happen after brewkit is required and that only happens in install now.
2009-10-15 16:48:07 +01:00
Max Howell
ca1a6492bc s/require 'brewkit'/require 'formula'/g
brewkit.rb changes ENV destructively, so lets not do that everytime a formula
is required. Now it's possible for other tools to require a formula
description without worrying about side-effects.
2009-10-15 16:48:03 +01:00
Max Howell
d5d56e6ace Don't allow interactive installs if deps aren't installed
Mainly because this feature is for devs and the code is too messy to fix it properly yet.
2009-10-09 00:09:05 +01:00
Max Howell
1974021718 Use full path to Ruby executable when installing 2009-10-04 17:49:49 +01:00
Max Howell
2edb971cd8 Fixes Homebrew/homebrew#78
`brew list` fails after fresh install because Cellar directory doesn't exist yet.
2009-10-04 17:49:49 +01:00
Mark Imbriaco
20ecb8d032 Fix brew if it's symlinked from elsewhere
Follow symlinks when trying to find HOMEBREW_RUBYLIB.

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

This is now supported usage, it wasn't before. I amended the patch quite heavily because it broke our other supported usage, ie. complete symlinking of Homebrew into /usr/local
2009-10-03 15:03:12 +01:00
Max Howell
c61d96529c brew list --unbrewed fix
Determine all directories that aren't Homebrew ones.

Exec find.

I prefer to keep short stuff in bin/brew so people reading the code have a better idea of what happens, and what sort of functions are useful for the sorts of things we do with Homebrew.
2009-09-30 18:11:49 +01:00
Andre Arko
195e75c1b2 Search by substring unless term is inside /../ 2009-09-29 23:34:16 +01:00
Kieran Pilkington
9169b675a3 Adding PATH for the debug environment. 2009-09-29 16:26:38 +01:00
Kieran Pilkington
aedaaf79bf brew list --unbrewed
Very quick way to find files not installed by homebrew.

Taken from a command by mxcl on the homebrew wiki.

.DS_Store files and bin/brew are ignored.
2009-09-29 16:26:37 +01:00
Adam Vandenberg
14daa31cd3 We require Xcode 3.1 *and later* 2009-09-29 14:23:00 +01:00
Max Howell
51f935c499 Show information messages after basic error checking. 2009-09-28 00:20:51 +01:00
Max Howell
1004df181e fix_PATH changed to warn_about_macports_or_fink
We shouldn't mess with the user's PATH anyway. So assume our users are smart and just warn them about potential issues instead.
2009-09-28 00:20:51 +01:00
Eloy Duran
5a2eae5d49 Only show the first 8 characters of the commit hashes. 2009-09-28 00:20:51 +01:00
Max Howell
b7bf860a48 Use MACOS_VERSION in bin/brew 2009-09-25 19:30:19 +01:00
Max Howell
235987b032 Don't summarize brew list if piped to another command 2009-09-25 18:06:37 +01:00