comparison mx/mx_graal.py @ 19427:9f037830060a

Make mx igv more robust against bad nbplatform states
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Tue, 17 Feb 2015 15:08:13 +0100
parents 5414f848de51
children 84b85c43633b
comparison
equal deleted inserted replaced
19426:dd8989d5547f 19427:9f037830060a
1715 mx.logv('[Ideal Graph Visualizer log is in ' + fp.name + ']') 1715 mx.logv('[Ideal Graph Visualizer log is in ' + fp.name + ']')
1716 nbplatform = join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'nbplatform') 1716 nbplatform = join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'nbplatform')
1717 1717
1718 # Remove NetBeans platform if it is earlier than the current supported version 1718 # Remove NetBeans platform if it is earlier than the current supported version
1719 if exists(nbplatform): 1719 if exists(nbplatform):
1720 dom = xml.dom.minidom.parse(join(nbplatform, 'platform', 'update_tracking', 'org-netbeans-core.xml')) 1720 updateTrackingFile = join(nbplatform, 'platform', 'update_tracking', 'org-netbeans-core.xml')
1721 currentVersion = mx.VersionSpec(dom.getElementsByTagName('module_version')[0].getAttribute('specification_version')) 1721 if not exists(updateTrackingFile):
1722 supportedVersion = mx.VersionSpec('3.43.1') 1722 mx.log('Could not find \'' + updateTrackingFile + '\', removing NetBeans platform')
1723 if currentVersion < supportedVersion:
1724 mx.log('Replacing NetBeans platform version ' + str(currentVersion) + ' with version ' + str(supportedVersion))
1725 shutil.rmtree(nbplatform) 1723 shutil.rmtree(nbplatform)
1726 elif supportedVersion < currentVersion: 1724 else:
1727 mx.log('Supported NetBeans version in igv command should be updated to ' + str(currentVersion)) 1725 dom = xml.dom.minidom.parse(updateTrackingFile)
1726 currentVersion = mx.VersionSpec(dom.getElementsByTagName('module_version')[0].getAttribute('specification_version'))
1727 supportedVersion = mx.VersionSpec('3.43.1')
1728 if currentVersion < supportedVersion:
1729 mx.log('Replacing NetBeans platform version ' + str(currentVersion) + ' with version ' + str(supportedVersion))
1730 shutil.rmtree(nbplatform)
1731 elif supportedVersion < currentVersion:
1732 mx.log('Supported NetBeans version in igv command should be updated to ' + str(currentVersion))
1728 1733
1729 if not exists(nbplatform): 1734 if not exists(nbplatform):
1730 mx.logv('[This execution may take a while as the NetBeans platform needs to be downloaded]') 1735 mx.logv('[This execution may take a while as the NetBeans platform needs to be downloaded]')
1731 # make the jar for Batik 1.7 available. 1736 # make the jar for Batik 1.7 available.
1732 env['IGV_BATIK_JAR'] = mx.library('BATIK').get_path(True) 1737 env['IGV_BATIK_JAR'] = mx.library('BATIK').get_path(True)