diff options
| author | Jack Nagel | 2014-04-20 22:39:47 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-04-20 22:39:47 -0500 |
| commit | a379fc7f7996dafaf40c926ae5b16ef3b7665589 (patch) | |
| tree | 278ab5667f9cd8ef7558e82de31deca45c886ea6 /Library/ENV | |
| parent | bef9ec29ef22c41d175df5a7296d736b21dfff45 (diff) | |
| download | brew-a379fc7f7996dafaf40c926ae5b16ef3b7665589.tar.bz2 | |
Remove nil split monkeypatch
Diffstat (limited to 'Library/ENV')
| -rwxr-xr-x | Library/ENV/4.3/cc | 13 | ||||
| -rw-r--r-- | Library/ENV/libsuperenv.rb | 1 |
2 files changed, 9 insertions, 5 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index 13ad9d7a4..cfa68f6cf 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -217,15 +217,17 @@ class Cmd syspath.map{|d| "#{d}/lib" }.reject{|d| d == "#{brewfix}/lib" } end def cpath - cpath = ENV['CMAKE_PREFIX_PATH'].split(':').map{|d| "#{d}/include" } + ENV['CMAKE_INCLUDE_PATH'].split(':') + cpath = path_split("CMAKE_PREFIX_PATH").map! { |d| File.join(d, "include") } + cpath += path_split("CMAKE_INCLUDE_PATH") opt = cpath.grep(%r{^#{Regexp.escape(brewfix)}/opt}) sys = cpath - opt [sys, opt] end def libpath - ENV['CMAKE_PREFIX_PATH'].split(':').map{|d| "#{d}/lib" } + - ENV['CMAKE_LIBRARY_PATH'].split(':') - - syslibpath + libpath = path_split("CMAKE_PREFIX_PATH").map! { |d| File.join(d, "lib") } + libpath += path_split("CMAKE_LIBRARY_PATH") + libpath -= syslibpath + libpath end def ldflags args = path_flags("-L", libpath) @@ -278,6 +280,9 @@ class Cmd paths = paths.uniq.select { |path| File.directory?(path) } paths.map! { |path| prefix + path } end + def path_split(key) + ENV.fetch(key) { "" }.split(File::PATH_SEPARATOR) + end end if __FILE__ == $PROGRAM_NAME diff --git a/Library/ENV/libsuperenv.rb b/Library/ENV/libsuperenv.rb index 1b4ffa19d..658d5d9ea 100644 --- a/Library/ENV/libsuperenv.rb +++ b/Library/ENV/libsuperenv.rb @@ -11,5 +11,4 @@ end class NilClass def chuzzle; end - def split(x); [] end end |
