diff options
| author | Jack Nagel | 2014-04-20 19:57:01 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-04-20 19:57:07 -0500 |
| commit | d1041319f401d1a3a559d551d7b6a89bc3f4ee0b (patch) | |
| tree | 727ca93a14adbb34a7ad02c46a9840427f195856 /Library | |
| parent | dfad695748071a75804c4168bec5ae81e4fcefa2 (diff) | |
| download | brew-d1041319f401d1a3a559d551d7b6a89bc3f4ee0b.tar.bz2 | |
Remove "cleanpath" monkeypatch
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/ENV/4.3/cc | 14 | ||||
| -rw-r--r-- | Library/ENV/libsuperenv.rb | 1 |
2 files changed, 11 insertions, 4 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index 727fa565a..d05e81074 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -1,6 +1,7 @@ #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0 require File.expand_path("../libsuperenv", File.dirname(__FILE__)) +require 'pathname' require 'set' require 'stringio' @@ -147,10 +148,12 @@ class Cmd when /^-I(.+)?/ # Support both "-Ifoo" (one argument) and "-I foo" (two arguments) path = $1.chuzzle || whittler.next - args << "-I#{path}" if keep?(path) and iset.add?(path.cleanpath) + path = canonical_path(path) + args << "-I#{path}" if keep?(path) and iset.add?(path) when /^-L(.+)?/ path = $1.chuzzle || whittler.next - args << "-L#{path}" if keep?(path) and lset.add?(path.cleanpath) + path = canonical_path(path) + args << "-L#{path}" if keep?(path) and lset.add?(path) else args << arg end @@ -159,7 +162,7 @@ class Cmd end def keep? path - case path.cleanpath + case path when %r{^#{Regexp.escape(brewfix)}}, %r{^#{Regexp.escape(brewtmp)}} # maybe homebrew is installed to /sw or /opt/brew true @@ -270,6 +273,11 @@ class Cmd def cccfg? flags flags.split('').all?{|c| ENV['HOMEBREW_CCCFG'].include? c } if ENV['HOMEBREW_CCCFG'] end + def canonical_path(path) + path = Pathname.new(path) + path = path.realpath if path.exist? + path.to_s + end end if __FILE__ == $PROGRAM_NAME diff --git a/Library/ENV/libsuperenv.rb b/Library/ENV/libsuperenv.rb index 5e7035eb2..c6b8c1c4b 100644 --- a/Library/ENV/libsuperenv.rb +++ b/Library/ENV/libsuperenv.rb @@ -6,7 +6,6 @@ $:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8" class String - def cleanpath; require 'pathname'; Pathname.new(self).realpath.to_s rescue self end def chuzzle; s = chomp; s unless s.empty? end end |
