82 Commits

Author SHA1 Message Date
Adam Vandenberg
7080ea0de6 Add 'HOMEBREW_DEBUG_PREFIX'
When doing "brew install -i", set the "HOMEBREW_DEBUG_PREFIX"
variable to the prefix of the formula being installed.
2010-08-20 10:03:38 -07:00
Adam Vandenberg
74a081e08d Make errors during link step more visible. 2010-08-15 17:17:59 -07:00
Adam Vandenberg
37ea70ed5e Shorten 'bad man path' message. 2010-07-29 12:25:50 -07:00
Adam Vandenberg
070421f441 Fix top-level formula having duplicate deps
If the top-level formula being installed has any keg-only
dependencies, the lib/include/bin/pkg-config paths for those
deps will be added twice to the ENV vars.

This doesn't break anything, but does make debug output somewhat longer
than it needs to be.

Tidy this up by calling uniq on deps before iterating.

(The cause of this duplication is related to how top-level formula are
run, to support keeping patches in __END__ blocks.)

Fixes Homebrew/homebrew#1110
2010-07-20 08:58:37 -07:00
Adam Vandenberg
d49c6d675e Bug fix for METAFILES that are actually directories.
If a package contains a folder that has the same name as one of our
expected meta files, skip trying to install that folder.

(Otherwise we install an empty folder and can get odd permission errors
when trying to summarize after install.)
2010-06-17 16:35:40 -07:00
Adam Vandenberg
8af39f115c Set HOMEBREW_DEBUG_INSTALL when in a shell during install -d|-i
When an "install -d formula" fails, and the user gets dropped into an
interactive shell, set the HOMEBREW_DEBUG_INSTALL env var to the name
for the formula that failed. Also set variable if the user requests an
interactive install in the first place.

Note that this may be different than the formula being installed, since
it may have been a dep that failed.

Also remove todo in utils; users can now look for HOMEBREW_DEBUG_INSTALL
in their prompt command, and adjust their prompts accordingly.
2010-06-15 08:09:58 -07:00
Adam Vandenberg
4777d6b4cf Warn if a keg-level "man" is found.
Homebrew expects manpages to be linked in shared/man/...
and not man/...
2010-06-01 16:25:35 -07:00
Adam Vandenberg
9ba8d5ede8 Move dump_build_env to utils and use during installs too. 2010-05-06 07:23:59 -07:00
Adam Vandenberg
48a5f6ca79 Merge keg_only? blocks in installer. 2010-05-02 18:12:48 -07:00
Adam Vandenberg
54b5a7afbb Add --git option to 'brew install -i'.
This allows for easy generation of diffs, per a trick in
http://wiki.github.com/mxcl/homebrew/formula-cookbook
2010-04-22 10:41:40 -07:00
Adam Vandenberg
bf6c7268b4 Force readme files to not be executable. 2010-04-06 07:50:22 -07:00
Max Howell
9851a75660 If keg only don't warn about s?bin not being in PATH
Fixes Homebrew/homebrew#488.
2010-01-18 09:12:48 +00:00
Max Howell
55f7b826d9 Check for $! before installing
If an exception is thrown while parsing the formula file before the install.rb at_exit then it will be in $!. Marshal it back to the parent brew process.
2009-11-12 01:37:02 +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
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
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
ac277f5c22 Show backtrace during non fatal install steps if --debug 2009-10-23 19:22:51 +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
9802bb0e19 Introduce :provided_by_osx for keg_only? 2009-10-12 22:41:16 +01:00
Max Howell
f785369e54 Add to PKG_CONFIG_PATH for keg-only deps
Also prepending to these vars now too as for kegs that are duplicates of OS X libs, we need to give them the edge and put them first.
2009-10-03 16:16:02 +01:00
Max Howell
512a3da886 brew list lists root keg files if not README, etc. 2009-09-30 17:45:38 +01:00
Max Howell
b80dd75a73 Allow returning true from keg_only? 2009-09-30 17:24:05 +01:00
Christian Mayer
edb89a7829 Axel formula
Axel tries to accelerate downloads by using multiple connections (possibly to
multiple servers) for one download. Because of its size, it might be very
useful on bootdisks or other small systems as a wget replacement.
2009-09-25 15:31:55 +01:00
Max Howell
01b85d8521 Automatically add keg_only? deps to relevent ENV
Eg gettext gets added into LDFLAGS, INCLUDE and that. I hope I got everything
that is typical. Prolly not. But we'll find out.

Made readline keg_only because the BSD version is provided by OS X, and I
don't want bug reports that are tricky to solve due to unexpected differences
between the two.
2009-09-21 20:23:09 +01:00
Max Howell
ee2b521ca8 Solving the GNU GetText issues
GNU GetText breaks eg. Ruby 1.9 builds, and some other formula I have been building too. But it is required by eg. glib. So to solve this we are going to by default not symlink gettext into the Homebrew prefix.

Formula that depend on GetText will have the gettext paths added to the brewing environment automatically. Neat.
2009-09-17 22:01:27 +01:00
Max Howell
357751633e Prettier install output
This way caveats and other warnings/errors don't appear connected to the Summary text.
2009-09-17 18:42:56 +01:00
Max Howell
b3c6c3f591 Warning for bin dirs not in the PATH
Eg. sbin may be part of the formula, but that isn't in the default Mac PATH. Also will avoid bug reports for users who forget to amend their PATH and stick Homebrew somewhere different.
2009-09-17 18:42:56 +01:00
Max Howell
c28bd7b571 Allow formulae to use __END__
For this to work the "running script" must be the formulae file. Making this
so wasn't so hard, there is now an install.rb script which is included with
the -r flag to the ruby executable. An at_exit handler calls the install
function.

Having the install logic in its own file made it feel like there was so much
space that I added extra error handling. So there is something to be said for
separating functionality out into its own files.

Still the error handling sucks, we'll need to marshall the exception back to
the bin/brew command. Which is another PITA.

Still overall I think this will prove worthwhile. But if it doesn't we'll
revert.

As a first usage, you can put a diff after __END__ and return DATA from
Formula::patches to make Homebrew aware of it.
2009-09-16 14:49:06 +01:00