38364 Commits

Author SHA1 Message Date
Max Howell
75c7c942a1 Don't ignore interupts during Formula.system
As I understand it (I tested too), signal propogation is handled by the parent Ruby process. However this was working mostly anyway. So I don't fully understand what is going on. However this seems to not hang in Process.wait where it was before for one test case.
2009-11-09 17:55:13 +00:00
Max Howell
1da26d89ea Don't use Kernel.system much
It just seems to behave strangely with SIGINT. Eg. SIGINT causes tar to exit, but the SIGINT is ignored by our process. This is not the case when used with curl.
2009-11-09 17:55:11 +00:00
Max Howell
590f64e302 Don't error out if .DS_Store is in a keg 2009-11-09 17:55:06 +00:00
Max Howell
20b7fa6ef8 Don't watch for spill for Quicktime stuff 2009-11-08 22:00:03 +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
80b555057c Ignore spill for certain system paths 2009-11-08 15:21:15 +00:00
Max Howell
fe15b9b003 Reap the process or make zombies 2009-11-08 15:21: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
2dc17b19f4 List --HEAD/-H in brew usage 2009-11-08 15:21:14 +00:00
Max Howell
22afc5e1c7 Use our own popen implementation in Formula.system
The rationale here is that the --verbose mode had a bug where it didn't escape its parameters properly. Which caused ocassionally cryptic issues.
2009-11-08 15:21:09 +00:00
Max Howell
1e879eaee8 Propagate exit status in ExecutioError exception 2009-11-07 18:22:36 +00:00
Max Howell
0ec10c68ca Include /Library in watch_out_for_spill 2009-11-07 18:22:36 +00:00
Max Howell
455271ed12 Blacklist RubyGems creation 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
57fc32d279 Solve the brew install, brew rm, brew install problem for HEAD formula
The problem was that git checkout -b doesn't work the second time. This simple solution works by never creating a local branch.
2009-11-07 18:22:36 +00:00
Erik Kastner
96de6ba870 adding zsh completion 2009-11-07 18:22:36 +00:00
Max Howell
a4e86bb326 Move BuildError and ExceutionError to global.h
More sensible, and fixes brew
2009-11-07 18:22:35 +00:00
Max Howell
6386ce4df5 Provide system info for build errors 2009-11-07 18:22:34 +00:00
Max Howell
7ec2874746 Fix ENV.m32 when LDFLAGS already exists 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
107235c5dd Typo correction 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
8f46b32d26 Raise if ARGV.next is out of bounds 2009-11-07 18:22:33 +00:00
Max Howell
78d7cbc812 Slightly better ARGV.usage for contribution 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
Max Howell
0cc45884bb Fixes Homebrew/homebrew#106; Don't downcase ARGV.named 2009-11-04 16:27:37 +00:00
Adam Vandenberg
c76d652da2 Tweak code to locate Cellar path.
I think this tweak to finding the Cellar path addresses one of mxcl's
concerns over supported install scenarios.
2009-11-04 16:27:36 +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
fc9ea77bb3 Better md5 mismatch exception 2009-10-24 16:20:11 +01:00
Max Howell
e289164adc Implement inreplace natively in Ruby
I found yet another instance where the escaping wasn't perfect, so got fed up and just did it in Ruby. I hope this works for all existing usage. It should.

The bonus here is that you can use RegExps now.
2009-10-23 19:22:51 +01:00
Bradley Grzesiak and Nick Karpenske
7375758c9a Warn that chown -R /usr/local may break mysql 2009-10-23 19:22:51 +01:00
Max Howell
d967421c6e The tests need the actual optparse apparently 2009-10-23 19:22:51 +01:00
Alexander Solovyov
6ca096125d Fixes Homebrew/homebrew#97: add fake optparse.rb 2009-10-23 19:22:51 +01:00
Max Howell
e1995d60ef Call to_s on ohai parameters 2009-10-23 19:22:51 +01:00
Max Howell
ac277f5c22 Show backtrace during non fatal install steps if --debug 2009-10-23 19:22:51 +01:00
Max Howell
3570214d20 Allow multiple formula to symlink the same directory
During the link step, if the destination symlink already exists, unlink it, and create a directory instead, then relink the original contents. Then continue linking the formula in question.

Fixes Homebrew/homebrew#62
2009-10-23 19:22:07 +01:00
Max Howell
03f37bef79 ENV.m32 2009-10-23 19:20:16 +01:00
Max Howell
6de6bffd55 ENV.osx_10_5 2009-10-23 19:20:16 +01:00
Max Howell
79530df421 Remove mercurial and scons from the create blacklist
Blacklist wxwidgets, it's in /usr/X11/lib.
2009-10-23 19:20:16 +01:00