changeset 12540:0aa37fd2f33e

mx: fix detection for sparc. ignore unparsable lines in jvm.cfg
author Bernhard Urban <bernhard.urban@jku.at>
date Wed, 23 Oct 2013 15:31:47 +0200
parents 97f56b7e978e
children eb9ac998b46f
files mx/commands.py
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mx/commands.py	Wed Oct 23 13:41:50 2013 +0200
+++ b/mx/commands.py	Wed Oct 23 15:31:47 2013 +0200
@@ -244,7 +244,7 @@
     if machine in ['amd64', 'AMD64', 'x86_64', 'i86pc']:
         return 'amd64'
     if machine in ['sun4v', 'sun4u']:
-        return 'sparc'
+        return 'sparcv9'
     if machine == 'i386' and mx.get_os() == 'darwin':
         try:
             # Support for Snow Leopard and earlier version of MacOSX
@@ -320,11 +320,14 @@
                 for line in f:
                     if line.startswith('-') and defaultVM is None:
                         parts = line.split()
-                        assert len(parts) == 2, parts
-                        assert parts[1] == 'KNOWN', parts[1]
-                        defaultVM = parts[0][1:]
-                        jvmCfgLines += ['# default VM is a copy of the unmodified ' + defaultVM + ' VM\n']
-                        jvmCfgLines += ['-original KNOWN\n']
+                        if len(parts) == 2:
+                            assert parts[1] == 'KNOWN', parts[1]
+                            defaultVM = parts[0][1:]
+                            jvmCfgLines += ['# default VM is a copy of the unmodified ' + defaultVM + ' VM\n']
+                            jvmCfgLines += ['-original KNOWN\n']
+                        else:
+                            # skip lines which we cannot parse (e.g. '-hotspot ALIASED_TO -client')
+                            pass
                     else:
                         jvmCfgLines += [line]