Replace remaining shelled-out whiches

This commit is contained in:
Misty De Meo 2013-03-21 08:17:26 -05:00
parent 8a33564cab
commit 29af53d451
3 changed files with 4 additions and 4 deletions

View File

@ -479,10 +479,10 @@ class << ENV
EOS
end
elsif `/usr/bin/which gfortran`.chuzzle
elsif which 'gfortran'
ohai "Using Homebrew-provided fortran compiler."
puts "This may be changed by setting the FC environment variable."
self['FC'] = `/usr/bin/which gfortran`.chomp
self['FC'] = which 'gfortran'
self['F77'] = self['FC']
fc_flag_vars.each {|key| self[key] = cflags}

View File

@ -46,7 +46,7 @@ undef cache # we use a function to prevent adding home_cache to the global scope
HOMEBREW_CACHE_FORMULA = HOMEBREW_CACHE+"Formula"
if not defined? HOMEBREW_BREW_FILE
HOMEBREW_BREW_FILE = ENV['HOMEBREW_BREW_FILE'] || `which brew`.chomp
HOMEBREW_BREW_FILE = ENV['HOMEBREW_BREW_FILE'] || which('brew').to_s
end
HOMEBREW_PREFIX = Pathname.new(HOMEBREW_BREW_FILE).dirname.parent # Where we link under

View File

@ -91,7 +91,7 @@ begin
ENV["HOMEBREW_#{e}"] = Object.const_get "HOMEBREW_#{e}"
end
exec "brew-#{cmd}", *ARGV
elsif require? `/usr/bin/which brew-#{cmd}.rb`
elsif require? which("brew-#{cmd}.rb").to_s
exit 0
else
onoe "Unknown command: #{cmd}"