Remove last monkeypatch
This commit is contained in:
parent
a379fc7f79
commit
cb58bd779b
@ -1,6 +1,6 @@
|
|||||||
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
|
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
|
||||||
|
|
||||||
require File.expand_path("../libsuperenv", File.dirname(__FILE__))
|
$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8"
|
||||||
require 'pathname'
|
require 'pathname'
|
||||||
require 'set'
|
require 'set'
|
||||||
require 'stringio'
|
require 'stringio'
|
||||||
@ -147,11 +147,11 @@ class Cmd
|
|||||||
args << "-Wl,#{arg}"
|
args << "-Wl,#{arg}"
|
||||||
when /^-I(.+)?/
|
when /^-I(.+)?/
|
||||||
# Support both "-Ifoo" (one argument) and "-I foo" (two arguments)
|
# Support both "-Ifoo" (one argument) and "-I foo" (two arguments)
|
||||||
val = $1.chuzzle || whittler.next
|
val = chuzzle($1) || whittler.next
|
||||||
path = canonical_path(val)
|
path = canonical_path(val)
|
||||||
args << "-I#{val}" if keep?(path) and iset.add?(path)
|
args << "-I#{val}" if keep?(path) and iset.add?(path)
|
||||||
when /^-L(.+)?/
|
when /^-L(.+)?/
|
||||||
val = $1.chuzzle || whittler.next
|
val = chuzzle($1) || whittler.next
|
||||||
path = canonical_path(val)
|
path = canonical_path(val)
|
||||||
args << "-L#{val}" if keep?(path) and lset.add?(path)
|
args << "-L#{val}" if keep?(path) and lset.add?(path)
|
||||||
else
|
else
|
||||||
@ -283,13 +283,18 @@ class Cmd
|
|||||||
def path_split(key)
|
def path_split(key)
|
||||||
ENV.fetch(key) { "" }.split(File::PATH_SEPARATOR)
|
ENV.fetch(key) { "" }.split(File::PATH_SEPARATOR)
|
||||||
end
|
end
|
||||||
|
def chuzzle(val)
|
||||||
|
return val if val.nil?
|
||||||
|
val = val.chomp
|
||||||
|
return val unless val.empty?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if __FILE__ == $PROGRAM_NAME
|
if __FILE__ == $PROGRAM_NAME
|
||||||
##################################################################### sanity
|
##################################################################### sanity
|
||||||
abort "The build-tool has reset ENV. --env=std required." unless ENV['HOMEBREW_BREW_FILE']
|
abort "The build-tool has reset ENV. --env=std required." unless ENV['HOMEBREW_BREW_FILE']
|
||||||
|
|
||||||
case ENV['HOMEBREW_CC'].chuzzle when 'cc', nil
|
if (cc = ENV["HOMEBREW_CC"]).nil? || cc.empty? || cc == "cc"
|
||||||
# those values are not allowed
|
# those values are not allowed
|
||||||
ENV['HOMEBREW_CC'] = 'clang'
|
ENV['HOMEBREW_CC'] = 'clang'
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
# Yes, a good deal of this could be imported from Homebrew-proper
|
|
||||||
# But Homebrew-proper is dog-slow currently, and I didn't want every cc
|
|
||||||
# instantiation to be slower by a tangible amount.
|
|
||||||
|
|
||||||
# https://github.com/Homebrew/homebrew-versions/issues/47
|
|
||||||
$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8"
|
|
||||||
|
|
||||||
class String
|
|
||||||
def chuzzle; s = chomp; s unless s.empty? end
|
|
||||||
end
|
|
||||||
|
|
||||||
class NilClass
|
|
||||||
def chuzzle; end
|
|
||||||
end
|
|
||||||
Loading…
x
Reference in New Issue
Block a user