aboutsummaryrefslogtreecommitdiffstats
path: root/Library/ENV
diff options
context:
space:
mode:
authorJack Nagel2013-11-21 14:50:35 -0600
committerJack Nagel2013-11-21 17:17:55 -0600
commita40a0e1862b134f5282eb4487444566ac7fb88ba (patch)
treeeafd76bc7f1b19893a83da039636207b6314db37 /Library/ENV
parent8c613e618b6a2205981baa6017075a65ecc6c04e (diff)
downloadbrew-a40a0e1862b134f5282eb4487444566ac7fb88ba.tar.bz2
Remove some monkeypatches
Diffstat (limited to 'Library/ENV')
-rwxr-xr-xLibrary/ENV/4.3/cc2
-rwxr-xr-xLibrary/ENV/4.3/xcrun10
-rw-r--r--Library/ENV/libsuperenv.rb6
3 files changed, 8 insertions, 10 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc
index 9172d3cea..7a40d2e38 100755
--- a/Library/ENV/4.3/cc
+++ b/Library/ENV/4.3/cc
@@ -40,7 +40,7 @@ end
class Cmd
def initialize path, args
- @arg0 = path.basename.freeze
+ @arg0 = File.basename(path).freeze
@args = args.freeze
end
def mode
diff --git a/Library/ENV/4.3/xcrun b/Library/ENV/4.3/xcrun
index 16600e240..6921bb3c4 100755
--- a/Library/ENV/4.3/xcrun
+++ b/Library/ENV/4.3/xcrun
@@ -4,19 +4,21 @@
# But many build-systems expect it to work. This fixes that.
# NOTE only works if the build-tool calls xcrun without a path prefixed!
-require "#{File.dirname __FILE__}/../libsuperenv"
-SUPERBIN = __FILE__.dirname.cleanpath.freeze
+dirname = File.dirname(__FILE__)
+require "#{dirname}/../libsuperenv"
+SUPERBIN = dirname.cleanpath.freeze
# Some build tools are stupid and still set DEVELOPER_DIR to old /Developer
ENV['DEVELOPER_DIR'] = ENV['HOMEBREW_DEVELOPER_DIR']
exec "/usr/bin/xcrun", *ARGV if ARGV.empty? or ARGV[0][0..0] == '-'
if File.exist?("/usr/bin/#{ARGV.first}")
- exec "/usr/bin/#{ARGV.shift}", *ARGV unless ENV['HOMEBREW_SDKROOT'].directory?
+ sdkroot = ENV['HOMEBREW_SDKROOT']
+ exec "/usr/bin/#{ARGV.shift}", *ARGV unless sdkroot and File.directory? sdkroot
end
def try path
- exec path, *ARGV if File.executable?(path) and path.cleanpath.dirname != SUPERBIN
+ exec path, *ARGV if File.executable?(path) and File.dirname(path.cleanpath) != SUPERBIN
end
arg0 = ARGV.shift
diff --git a/Library/ENV/libsuperenv.rb b/Library/ENV/libsuperenv.rb
index e08fbba4d..c87e6a499 100644
--- a/Library/ENV/libsuperenv.rb
+++ b/Library/ENV/libsuperenv.rb
@@ -6,22 +6,18 @@
$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8"
class String
- def directory?; File.directory? self end
- def basename; File.basename self end
def cleanpath; require 'pathname'; Pathname.new(self).realpath.to_s rescue self end
def chuzzle; s = chomp; s unless s.empty? end
- def dirname; File.dirname(self) end
end
class NilClass
def chuzzle; end
- def directory?; false end
def split(x); [] end
end
class Array
def to_flags prefix
- select{|path| path.directory? }.uniq.map{|path| prefix+path }
+ select { |path| File.directory? path }.uniq.map { |path| prefix + path }
end
end