diff options
| author | Andre Arko | 2010-02-09 11:30:16 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2010-02-25 09:17:00 -0800 |
| commit | 0d4933ba6fc9ef205fd2bda00da52fe342ba1f91 (patch) | |
| tree | 7b613b14bc17ac8a9bb0873b0a95cf178a198148 | |
| parent | f7e234be26428351c5aed0252d1d378ce313eac9 (diff) | |
| download | homebrew-0d4933ba6fc9ef205fd2bda00da52fe342ba1f91.tar.bz2 | |
Add support for external ruby deps, and fix external deps system.
Kernel#system special-cases the first argument, so you have to
make the first argument the entire command to be invoked, and
subsequent arguments the actual arguments to that command. In
order to use the user's interpreter, the first argument must be
"/usr/bin/env <name>".
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 66cf35dcd..8fdc77dbe 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -27,7 +27,6 @@ Unsatisfied dependency, #{dep} Homebrew does not provide formula for Python dependencies, pip does: #{brew_pip} pip install #{dep} - EOS end def plerr dep; <<-EOS @@ -35,7 +34,13 @@ Unsatisfied dependency, #{dep} Homebrew does not provide formula for Perl dependencies, cpan does: cpan -i #{dep} - + EOS + end + def rberr dep; <<-EOS +Unsatisfied dependency "#{dep}" +Homebrew does not provide formulae for Ruby dependencies, rubygems does: + + gem install #{dep} EOS end @@ -43,24 +48,32 @@ Homebrew does not provide formula for Perl dependencies, cpan does: return unless f.external_deps f.external_deps[:python].each do |dep| - raise pyerr(dep) unless quiet_system "/usr/bin/python", "-c", "import #{dep}" + raise pyerr(dep) unless quiet_system "/usr/bin/env", "python", "-c", "import #{dep}" end f.external_deps[:perl].each do |dep| - raise plerr(dep) unless quiet_system "/usr/bin/perl", "-e", "use #{dep}" + raise plerr(dep) unless quiet_system "/usr/bin/env", "perl", "-e", "use '#{dep}'" + end + f.external_deps[:ruby].each do |dep| + raise rberr(dep) unless quiet_system "/usr/bin/env", "ruby", "-rubygems", "-e", "require '#{dep}'" end end - def install f + def check_formula_deps f expand_deps(f).each do |dep| begin - check_external_deps f install_private dep unless dep.installed? rescue #TODO continue if this is an optional dep raise end - end if @install_deps - + end + end + + def install f + if @install_deps + check_external_deps f + check_formula_deps f + end install_private f end |
