diff options
| author | Jack Nagel | 2013-03-03 22:28:12 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-03-06 17:06:07 -0600 |
| commit | df1d27b037ad2415d0369a829701e290722a1a99 (patch) | |
| tree | d26633a96d12a53d55fd63c49c304bd25b372740 /Library | |
| parent | 4adf0b0f69f3989ecd5208148915a57ba8411695 (diff) | |
| download | brew-df1d27b037ad2415d0369a829701e290722a1a99.tar.bz2 | |
superenv/cc: keep exec monkeypatch out of Object
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/ENV/4.3/cc | 25 |
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 |
