diff options
| author | Misty De Meo | 2012-05-19 19:57:56 -0500 |
|---|---|---|
| committer | Misty De Meo | 2012-06-01 09:24:25 -0500 |
| commit | d727f8b7f34d6d355bf64233cf49287012f457bc (patch) | |
| tree | 5eb9eeb49fefca73caad3bc646e99a0e59366aaf /Library/Formula | |
| parent | 616a3fc051e33be76a06708985df66208a0d00e7 (diff) | |
| download | homebrew-d727f8b7f34d6d355bf64233cf49287012f457bc.tar.bz2 | |
Replace /usr/bin/ruby with full Framework path
Rationale: some users insist on replacing the /usr/bin/ruby symlink
to point to another ruby on their system, which may break homebrew.
Use the full Framework path instead, which is less likely to be tampered with.
This also reorganizes the brew --config checks to reflect the different path.
Fixes #12009.
Closes #12333.
Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/rrdtool.rb | 5 | ||||
| -rw-r--r-- | Library/Formula/rubinius.rb | 20 |
2 files changed, 14 insertions, 11 deletions
diff --git a/Library/Formula/rrdtool.rb b/Library/Formula/rrdtool.rb index 9a02ee556..ece3c4cb3 100644 --- a/Library/Formula/rrdtool.rb +++ b/Library/Formula/rrdtool.rb @@ -28,13 +28,14 @@ class Rrdtool < Formula which_perl = which 'perl' which_ruby = which 'ruby' + ruby_path = "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby" - opoo "Using system Ruby. RRD module will be installed to /Library/Ruby/..." if which_ruby == "/usr/bin/ruby" + opoo "Using system Ruby. RRD module will be installed to /Library/Ruby/..." if which_ruby.realpath == ruby_path opoo "Using system Perl. RRD module will be installed to /Library/Perl/..." if which_perl == "/usr/bin/perl" args = ["--disable-dependency-tracking", "--prefix=#{prefix}", "--mandir=#{man}"] args << "--enable-perl-site-install" if which_perl == "/usr/bin/perl" - args << "--enable-ruby-site-install" if which_ruby == "/usr/bin/ruby" + args << "--enable-ruby-site-install" if which_ruby.realpath == ruby_path system "./configure", *args diff --git a/Library/Formula/rubinius.rb b/Library/Formula/rubinius.rb index 1310364d5..0cc1894f5 100644 --- a/Library/Formula/rubinius.rb +++ b/Library/Formula/rubinius.rb @@ -20,18 +20,20 @@ class Rubinius < Formula # Set to stop Rubinius messing with our prefix. ENV["RELEASE"] = "1" - system "/usr/bin/ruby", "./configure", - "--skip-system", # download and use the prebuilt LLVM - "--bindir", bin, - "--prefix", prefix, - "--includedir", "#{include}/rubinius", - "--libdir", lib, - "--mandir", man, # For completeness; no manpages exist yet. - "--gemsdir", "#{lib}/rubinius/gems" + ruby = "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby" + + system ruby, "./configure", + "--skip-system", # download and use the prebuilt LLVM + "--bindir", bin, + "--prefix", prefix, + "--includedir", "#{include}/rubinius", + "--libdir", lib, + "--mandir", man, # For completeness; no manpages exist yet. + "--gemsdir", "#{lib}/rubinius/gems" ohai "config.rb", File.open('config.rb').to_a if ARGV.debug? or ARGV.verbose? - system "/usr/bin/ruby", "-S", "rake", "install" + system ruby, "-S", "rake", "install" # Remove conflicting command aliases bin.children.select(&:symlink?).each(&:unlink) |
