diff options
| author | Jack Nagel | 2015-04-25 22:07:06 -0400 |
|---|---|---|
| committer | Jack Nagel | 2015-04-25 23:14:05 -0400 |
| commit | 16dfe3dd4000ce3d97cb2a0087946c9b2ead5665 (patch) | |
| tree | 7ad33cac510a78e8d925c54e09be88294bdf39ab /Library/Homebrew/formula.rb | |
| parent | f5d6d80d5bac2c83a89021481812b461c54cfba3 (diff) | |
| download | brew-16dfe3dd4000ce3d97cb2a0087946c9b2ead5665.tar.bz2 | |
Add Formula#logs
Diffstat (limited to 'Library/Homebrew/formula.rb')
| -rw-r--r-- | Library/Homebrew/formula.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 1844171c9..19852beb5 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -410,6 +410,10 @@ class Formula # there after pouring a bottle. def bottle_prefix; prefix+'.bottle' end + def logs + HOMEBREW_LOGS+name + end + # override this to provide a plist def plist; nil; end alias :startup_plist :plist @@ -510,7 +514,7 @@ class Formula begin yield self ensure - cp Dir["config.log", "CMakeCache.txt"], HOMEBREW_LOGS+name + cp Dir["config.log", "CMakeCache.txt"], logs end end end @@ -790,9 +794,8 @@ class Formula @exec_count ||= 0 @exec_count += 1 - logd = HOMEBREW_LOGS/name - logfn = "#{logd}/%02d.%s" % [@exec_count, File.basename(cmd).split(' ').first] - mkdir_p(logd) + logfn = "#{logs}/%02d.%s" % [@exec_count, File.basename(cmd).split(' ').first] + logs.mkpath File.open(logfn, "w") do |log| log.puts Time.now, "", cmd, args, "" |
