diff mx/outputparser.py @ 4225:339cf8d4904d

Made mx.run work properly when stderr is redirected to stdout. Made outputparser redirect stderr to stdout. Added copyright headers to outputparser.py and sanitycheck.py. Reverted class path construction in mx.build() to use includeSelf=True to fix regression when running 'mx build -c'.
author Doug Simon <doug.simon@oracle.com>
date Thu, 05 Jan 2012 11:31:46 +0100
parents 47f7d91d34cf
children 063ea022532c
line wrap: on
line diff
--- a/mx/outputparser.py	Wed Jan 04 23:34:15 2012 +0100
+++ b/mx/outputparser.py	Thu Jan 05 11:31:46 2012 +0100
@@ -1,5 +1,31 @@
+# ----------------------------------------------------------------------------------------------------
+#
+# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+# ----------------------------------------------------------------------------------------------------
+
 import mx
 import commands
+import subprocess
 
 class OutputParser:
     
@@ -27,7 +53,7 @@
             else :
                 mx.log( line.rstrip())
         
-        retcode = commands.vm(cmd, vm, nonZeroIsFatal=self.nonZeroIsFatal, out=parseLine, err=parseLine, cwd=cwd, vmbuild=vmbuild)
+        retcode = commands.vm(cmd, vm, nonZeroIsFatal=self.nonZeroIsFatal, out=parseLine, err=subprocess.STDOUT, cwd=cwd, vmbuild=vmbuild)
         return {'parsed' : ret, 'retcode' : retcode}
 
 class Matcher:
@@ -50,7 +76,7 @@
     def parsestr(self, match, key):
         if isinstance(key, tuple):
             if len(key) != 2:
-                raise Exception('Tuple arguments must have a lenght of 2')
+                raise Exception('Tuple arguments must have a length of 2')
             tup1, tup2 = key
             # check if key is a function
             if hasattr(tup1, '__call__'):