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
commita1c8e6a96058989afe9ac9fb52caac4f6bc24695 (patch)
treeaea9b799dce09fcadbd92f693d2c15397d782ef1 /Library
parentdc7650fcedce16340ad9d356449b937f9fef451d (diff)
downloadhomebrew-a1c8e6a96058989afe9ac9fb52caac4f6bc24695.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