Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Replace /usr/bin/ruby with full Framework path #12333

Closed
wants to merge 1 commit into from

3 participants

@mistydemeo
Owner

re: #12009, this commit replaces all usages of /usr/bin/ruby with the full Framework path, which is hopefully less likely to be altered.

Since we're no longer dealing with a default ruby path which is a symlink, I simplified the brew --config checks for the system ruby.

@mistydemeo
Owner

I've given this a runthrough and doesn't seem to have broken anything.

@mikemcquaid
Owner

Good idea although I wonder if /Versions/1.8/ might be even better considering we die on our arse with 1.9.

@mistydemeo mistydemeo 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.
db1c246
@mistydemeo
Owner

Good point - updated the path to /Versions/1.8/

@mistydemeo
Owner

I'm going to push this later today if there are no other comments/objections.

@jacknagel
Collaborator

:thumbsup:

@mikemcquaid
Owner

Go for it.

@mistydemeo mistydemeo closed this pull request from a commit
@mistydemeo mistydemeo 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>
d727f8b
@mistydemeo mistydemeo closed this in d727f8b
@mistydemeo
Owner

Pushed!

(I guess "later today" turned into "two days later"...)

@Sharpie Sharpie referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@petrhosek petrhosek referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Sharpie Sharpie referenced this pull request from a commit in Sharpie/homebrew
@mistydemeo mistydemeo 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>
2e2a52d
@chrismetcalf chrismetcalf referenced this pull request from a commit in chrismetcalf/homebrew
@mistydemeo mistydemeo 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>
1ee4f53
@zhangcheng zhangcheng referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@CharlieRoot CharlieRoot referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Sharpie Sharpie referenced this pull request from a commit in Sharpie/homebrew
@mistydemeo mistydemeo 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>
3057477
@pekkanikander pekkanikander referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@snakeyroc3 snakeyroc3 referenced this pull request from a commit in snakeyroc3/homebrew
@mistydemeo mistydemeo 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>
6e7ea05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 20, 2012
  1. @mistydemeo

    Replace /usr/bin/ruby with full Framework path

    mistydemeo authored
    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.
This page is out of date. Refresh to see the latest.
View
2  Library/Contributions/brew_bash_completion.sh
@@ -95,7 +95,7 @@ __brew_complete_tapped ()
__brew_complete_taps ()
{
if [[ -z "$__brew_cached_taps" ]]; then
- __brew_cached_taps="$(/usr/bin/ruby -e '
+ __brew_cached_taps="$(/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -e '
require "open-uri"
require "yaml"
View
2  Library/Contributions/cmds/brew-server
@@ -1,4 +1,4 @@
-#!/usr/bin/ruby
+#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
## brew server: Run a local webserver for browsing available and installed brews.
# Note: this external command is ruby, but set up as a shell script, so that it gets exec'd.
View
2  Library/Contributions/install_homebrew.rb
@@ -1,4 +1,4 @@
-#!/usr/bin/ruby
+#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like.
View
5 Library/Formula/rrdtool.rb
@@ -28,13 +28,14 @@ def install
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
View
6 Library/Formula/rubinius.rb
@@ -20,7 +20,9 @@ def install
# Set to stop Rubinius messing with our prefix.
ENV["RELEASE"] = "1"
- system "/usr/bin/ruby", "./configure",
+ 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,
@@ -31,7 +33,7 @@ def install
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)
View
2  Library/Homebrew/build.rb
@@ -1,4 +1,4 @@
-#!/usr/bin/ruby
+#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
# This script is called by formula_installer as a separate instance.
# Rationale: Formula can use __END__, Formula can change ENV
View
6 Library/Homebrew/cmd/--config.rb
@@ -91,10 +91,7 @@ def dump_build_config
puts hardware
puts "MacOS: #{MACOS_FULL_VERSION}-#{kernel}"
puts "Xcode: #{xcode_version}"
- puts "/usr/bin/ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}" if RUBY_VERSION.to_f != 1.8
-
- ruby = Pathname.new("/usr/bin/ruby")
- puts "/usr/bin/ruby => #{ruby.realpath}" unless ruby.realpath.to_s =~ %r{^/System}
+ puts "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby:\n #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}" if RUBY_VERSION.to_f != 1.8
ponk = macports_or_fink_installed?
puts "MacPorts/Fink: #{ponk}" if ponk
@@ -119,7 +116,6 @@ def config_s; <<-EOS.undent
MacPorts or Fink? #{macports_or_fink_installed?}
X11: #{describe_x11}
System Ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}
- /usr/bin/ruby => #{real_path("/usr/bin/ruby")}
Which Perl: #{describe_perl}
Which Python: #{describe_python}
Which Ruby: #{describe_ruby}
View
2  Library/Homebrew/formula_installer.rb
@@ -195,7 +195,7 @@ def build
begin
read.close
exec '/usr/bin/nice',
- '/usr/bin/ruby',
+ '/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby',
'-I', Pathname.new(__FILE__).dirname,
'-rbuild',
'--',
View
2  bin/brew
@@ -1,4 +1,4 @@
-#!/usr/bin/ruby
+#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
# -*- coding: utf-8 -*-
HOMEBREW_BREW_FILE = ENV['HOMEBREW_BREW_FILE'] = File.expand_path(__FILE__)
Something went wrong with that request. Please try again.