475 Commits

Author SHA1 Message Date
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
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
Piotr Usewicz
4ed3834be0 Add full version and build numbers to user agent
Signed-off-by: Max Howell <max@methylblue.com>

I adapted it slightly based on the user agent that Safari gives.
2009-09-25 01:24:05 +01:00
Max Howell
bab6515668 Summarised listings with brew list
I'm trying to only show the interesting stuff. You can see a full listing with
brew -v list, or by piping to other commands.

Tell me if you hate it or love it.
2009-09-24 22:38:42 +01:00
Max Howell
bfb3e1bfe0 brew log command
Shows the git-log for that formula.
2009-09-24 21:09:46 +01:00
Max Howell
44a1fa418e Use full paths to all system utilities
Otherwise you run the risk of not running the exact version / make of the utility you planned.

Fixes Homebrew/homebrew#48

Really we need to do this formula too, so I guess a make and cmake function are on the way…
2009-09-24 18:26:24 +01:00
Max Howell
034fc40ae1 Remove Fink and Macports from the PATH earlier
References issue Homebrew/homebrew#48
2009-09-24 18:26:24 +01:00
Max Howell
a03d13088f Return non-zero error code on errors
Stupidly I figured Ruby did this for us, but why would it?
2009-09-24 18:26:24 +01:00
Max Howell
6f4c61e326 brew install --ignore-dependencies
I used the same option flag as ruby gems does.
2009-09-22 19:58:10 +01:00
Adam Vandenberg
8d7ebb8ba3 length, not count. Fixes issue 55. 2009-09-21 16:53:04 -07:00
Max Howell
444e2e05fc Remove some ohai() use
Ohai is for titles, to separate sections of output so it is more readable, it
truncates long lines for this purpose. So don't use it if the line you are
outputting is likely to be long and important. Instead prefix that line with
a summary header.
2009-09-21 22:02:35 +01:00
Max Howell
e9701dbc81 Merge branch 'deps'
Conflicts:
	Library/Formula/imagemagick.rb
	Library/Formula/taglib.rb
	Library/Homebrew/brew.h.rb
	Library/Homebrew/formula.rb
	bin/brew
2009-09-21 18:46:28 +01:00
Max Howell
77dd27e8e6 Dependency resolution with fancy syntax
Is it a DSL? No. But people call it that apparently.

To add a dependency:

class Doe <Formula
  depends_on 'ray'
  depends_on 'mee' => :optional
  depends_on 'far' => :recommended
  depends_on Sew.new
end

Sew would be a formula you have defined in this Formula file. This is useful,
eg. see Python's formula. Formula specified in this fashion cannot be linked
into the HOMEBREW_PREFIX, they are considered private libraries. This allows
you to create custom installations that are very specific to your formula.

More features to come, like specifying versions
2009-09-21 18:27:48 +01:00
Max Howell
3d421c8649 Update references to masterbrew
I left update_from_masterbrew! as a historical reference.
2009-09-18 14:32:21 +01:00
Max Howell
a7315fce20 Error out if HOMEBREW_PREFIX isn't writable 2009-09-17 18:42:56 +01:00
Max Howell
710a160b8f Rename refresh_brew.rb to update.rb
I didn't change the class name, it's clear from the context where it is used what it does. However when just looking at files to figure out the nature of Homebrew I believe in clear naming.

Otherwise funny names earn you points.
2009-09-17 18:39:58 +01:00
Eloy Duran
3b8f3ad409 Made the output of updating a bit nicer and log more if --verbose. 2009-09-17 00:24:11 +02:00
Eloy Duran
4691fcb3d7 Don't print that there are _and_ aren't formulae updates. 2009-09-17 00:24:11 +02:00
Eloy Duran
9ff551a524 Removed the old 'update' when clause and fixed a small spelling error. 2009-09-17 00:24:11 +02:00
Eloy Duran
c1989b79ad Update Homebrew and list the updated formulae. 2009-09-17 00:24:11 +02: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
Max Howell
a793e30405 Only allow --interactive with one formula argument
See comments in commit for details.
2009-09-10 19:23:03 +01:00
Max Howell
fdaa267fb9 Don't install dependencies that are already installed 2009-09-10 19:23:03 +01:00
Max Howell
0a31190fdc Dependency resolution
Specify dependencies in your formula's deps function. You can return an Array,
String or Hash, eg:

    def deps
      { :optional => 'libogg', :required => %w[flac sdl], :recommended => 'cmake' }
    end

Note currently the Hash is flattened and qualifications are ignored. If you
only return an Array or String, the qualification is assumed to be :required.

Other packaging systems have problems when it comes to packages requiring a
specific version of a package, or some patches that may not work well with
other software. With Homebrew we have some options:

1.  If the formula is vanilla but an older version we can cherry-pick the old
    version and install it in the Cellar in parallel, but just not symlink it
    into /usr/local while forcing the formula that depends on it to link to
    that one and not any other versions of it.
2.  If the dependency requires patches then we shouldn't install this for use
    by any other tools, (I guess this needs to be decided on a per-situation
    basis). It can be installed into the parent formula's prefix, and not
    symlinked into /usr/local. In this case the dependency's Formula
    derivation should be saved in the parent formula's file (check git or
    flac for an example of this).

Both the above can be done currently with hacks, so I'll flesh out a proper
way sometime this week.
2009-09-10 19:23:03 +01:00
Max Howell
edc0f7ba20 Include OS X version with fatal error details
So when people do what it says and list the info we know in advance their OS
version.
2009-09-10 17:21:14 +01:00
Max Howell
fc52e1a69d brew make' becomes brew create'
This is because I have observed two people confuse make with the "make" tool
and thus assume `brew make' is `brew install'.

`brew make' will be deprecated at 0.7, until then it shows a warning.
2009-09-07 01:34:40 +01:00
Max Howell
680e201923 Fix double newline after Interrupt
Seems to be an issue with Ruby system() call doing a double fork.
2009-09-05 20:46:07 +01:00
Max Howell
64e767155a FIX installed but not installed state.
Pressing CTRL-C during installs would remove the prefix but not the keg directory. brew list would then report this keg as installed, even though it was empty.
2009-09-05 20:45:21 +01:00
scoates
7709c3699a Use ENV[EDITOR] if possible
Defaulting to EDITOR, then checking for the mate command, and then using
vim as a last resort.

Signed Off By: Max Howell <max@methylblue.com>

Plain brew edit still uses Textmate though because a client that
supported a project concept is required for that particular feature.
Patches for that welcome.
2009-09-05 19:10:56 +01:00
Andre Arko
c4041f4492 `brew search' command
Example usage:
  brew search w  # formulae containing w
  brew search ^w # formulae starting with w

No parameters lists all packages.

Also adds puts_columns to util, and uses it for output.

Signed Off By: Max Howell <max@methylblue.com>

I changed the command from 'available' to search because this is more similar
to how other tools call this function.

The short form is -S, which is the "pacman" tool equivalent.
2009-09-05 15:09:17 +01:00
Eloy Duran
a4ba1c137f watch_out_for_spill
New method which uses RubyCocoa with the FSEvents API from Rucola to watch if
files aren't installed outside the Homebrew prefix. Right now the paths being
watched are: /System, /usr, /etc, /sbin, /bin, and /Applications.
2009-09-05 14:35:15 +01:00