aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-03-03 22:28:12 -0600
committerJack Nagel2013-03-06 17:06:07 -0600
commitdf1d27b037ad2415d0369a829701e290722a1a99 (patch)
treed26633a96d12a53d55fd63c49c304bd25b372740 /Library
parent4adf0b0f69f3989ecd5208148915a57ba8411695 (diff)
downloadbrew-df1d27b037ad2415d0369a829701e290722a1a99.tar.bz2
superenv/cc: keep exec monkeypatch out of Object
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/ENV/4.3/cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc
index fb56a0581..8bd7e6ad2 100755
--- a/Library/ENV/4.3/cc
+++ b/Library/ENV/4.3/cc
@@ -21,18 +21,20 @@ def syspath
%W{/usr /usr/local}
end
end
-def exec *args
- path = File.expand_path('~/Library/Logs/Homebrew/cc.log')
- open(path, 'a') do |f|
- f.print '[', $0
- f.print " -%s" % ENV['HOMEBREW_CCCFG'] if ENV['HOMEBREW_CCCFG']
- f.print '] '
- f.puts args.join(' ')
- f.puts
- end
- Kernel.exec *args
-end if ENV['HOMEBREW_LOG']
+module ExecLogExtension
+ def exec *args
+ path = File.expand_path('~/Library/Logs/Homebrew/cc.log')
+ open(path, 'a') do |f|
+ f.print '[', $0
+ f.print " -%s" % ENV['HOMEBREW_CCCFG'] if ENV['HOMEBREW_CCCFG']
+ f.print '] '
+ f.puts args.join(' ')
+ f.puts
+ end
+ Kernel.exec *args
+ end
+end
class Cmd
def initialize path, args
@@ -206,6 +208,7 @@ if __FILE__ == $PROGRAM_NAME
end
####################################################################### main
+ extend(ExecLogExtension) if ENV['HOMEBREW_LOG']
cmd = Cmd.new($0, ARGV)
exec "xcrun", cmd.tool, *cmd.args
end