# HG changeset patch # User Doug Simon # Date 1366029815 -7200 # Node ID 0c9c4ae236b29670a3f5cd634dc9d0235d152987 # Parent 35e31499ae9e11f6b665941b30d3f57c02544870 refactoring to ensure the path to the JDKs dir is consistent between the _jdk() and clean() command diff -r 35e31499ae9e -r 0c9c4ae236b2 mx/commands.py --- a/mx/commands.py Mon Apr 15 14:31:24 2013 +0200 +++ b/mx/commands.py Mon Apr 15 14:43:35 2013 +0200 @@ -80,7 +80,7 @@ rmIfExists(join(_graal_home, 'build')) rmIfExists(join(_graal_home, 'build-nograal')) - rmIfExists(join(_graal_home, 'jdk' + str(mx.java().version))) + rmIfExists(_jdksDir()) rmIfExists(mx.distribution('GRAAL').path) def export(args): @@ -302,11 +302,14 @@ return join(jdk, 'jre', 'lib', _arch(), 'jvm.cfg') return join(_vmLibDirInJdk(jdk), 'jvm.cfg') +def _jdksDir(): + return join(_graal_home, 'jdk' + str(mx.java().version)) + def _jdk(build='product', vmToCheck=None, create=False): """ Get the JDK into which Graal is installed, creating it first if necessary. """ - jdk = join(_graal_home, 'jdk' + str(mx.java().version), build) + jdk = join(_jdksDir(), build) srcJdk = mx.java().jdk jdkContents = ['bin', 'include', 'jre', 'lib'] if exists(join(srcJdk, 'db')):