diff options
| author | Jack Nagel | 2015-04-25 22:07:06 -0400 | 
|---|---|---|
| committer | Jack Nagel | 2015-04-25 23:14:05 -0400 | 
| commit | be74724ceb0b29fb75d322be50773eb2e30b0c10 (patch) | |
| tree | 0561d28b33f67b82773f6a7537b795ce455b2b0e /Library/Homebrew/formula.rb | |
| parent | 606127a8f43b67a4a695a5c4d3739a44b7a577d8 (diff) | |
| download | homebrew-be74724ceb0b29fb75d322be50773eb2e30b0c10.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, "" | 
