aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-04-20 22:39:47 -0500
committerJack Nagel2014-04-20 22:39:47 -0500
commitaedf9cccd9d92c45b47a100099efccff2160c43d (patch)
treead8af2426f70817674ae15904cf06a9b2b5c408c /Library
parentb47c7158d684f2e0454168f130f0414ea9d63105 (diff)
downloadhomebrew-aedf9cccd9d92c45b47a100099efccff2160c43d.tar.bz2
Remove last monkeypatch
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/ENV/4.3/cc13
-rw-r--r--Library/ENV/libsuperenv.rb14
2 files changed, 9 insertions, 18 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc
index cfa68f6cf..b6ecfea88 100755
--- a/Library/ENV/4.3/cc
+++ b/Library/ENV/4.3/cc
@@ -1,6 +1,6 @@
#!/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 'set'
require 'stringio'
@@ -147,11 +147,11 @@ class Cmd
args << "-Wl,#{arg}"
when /^-I(.+)?/
# Support both "-Ifoo" (one argument) and "-I foo" (two arguments)
- val = $1.chuzzle || whittler.next
+ val = chuzzle($1) || whittler.next
path = canonical_path(val)
args << "-I#{val}" if keep?(path) and iset.add?(path)
when /^-L(.+)?/
- val = $1.chuzzle || whittler.next
+ val = chuzzle($1) || whittler.next
path = canonical_path(val)
args << "-L#{val}" if keep?(path) and lset.add?(path)
else
@@ -283,13 +283,18 @@ class Cmd
def path_split(key)
ENV.fetch(key) { "" }.split(File::PATH_SEPARATOR)
end
+ def chuzzle(val)
+ return val if val.nil?
+ val = val.chomp
+ return val unless val.empty?
+ end
end
if __FILE__ == $PROGRAM_NAME
##################################################################### sanity
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
ENV['HOMEBREW_CC'] = 'clang'
end
diff --git a/Library/ENV/libsuperenv.rb b/Library/ENV/libsuperenv.rb
deleted file mode 100644
index 658d5d9ea..000000000
--- a/Library/ENV/libsuperenv.rb
+++ /dev/null
@@ -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