You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by dj...@apache.org on 2009/07/09 03:39:00 UTC

svn commit: r792372 - /buildr/trunk/lib/buildr/core/util.rb

Author: djspiewak
Date: Thu Jul  9 01:39:00 2009
New Revision: 792372

URL: http://svn.apache.org/viewvc?rev=792372&view=rev
Log:
Added exitstatus method to ProcessStatus

Modified:
    buildr/trunk/lib/buildr/core/util.rb

Modified: buildr/trunk/lib/buildr/core/util.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/util.rb?rev=792372&r1=792371&r2=792372&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/util.rb (original)
+++ buildr/trunk/lib/buildr/core/util.rb Thu Jul  9 01:39:00 2009
@@ -314,11 +314,12 @@
   
   module Buildr
     class ProcessStatus
-      attr_reader :pid, :termsig, :stopsig
+      attr_reader :pid, :termsig, :stopsig, :exitstatus
       
-      def initialize(pid, success)
+      def initialize(pid, success, exitstatus)
         @pid = pid
         @success = success
+        @exitstatus = exitstatus
         
         @termsig = nil
         @stopsig = nil
@@ -395,12 +396,12 @@
         args = if cmd.size > 1 then cmd[1..cmd.size] else [] end
         
         res = if Buildr::Util.win_os? && cmd.size == 1
-          __native_system__("#{cd} call #{cmd.first}") == 0
+          __native_system__("#{cd} call #{cmd.first}")
         else
           arg_str = args.map { |a| "'#{a}'" }
-          __native_system__(cd + cmd.first + ' ' + arg_str.join(' ')) == 0
+          __native_system__(cd + cmd.first + ' ' + arg_str.join(' '))
         end
-        $? = Buildr::ProcessStatus.new(0, res)    # KLUDGE
+        $? = Buildr::ProcessStatus.new(0, res == 0, res)    # KLUDGE
         
         block.call(res, $?)
       end