# HG changeset patch # User Bernhard Urban # Date 1392036680 -3600 # Node ID 9d70445ea3698c38ed82134b0172e1c7b6e13ec6 # Parent 22bf5a8ba9ebbce0fb127928d48ab51f1a3b6239 mx: set correct permissions for graal.jar diff -r 22bf5a8ba9eb -r 9d70445ea369 mx/mx_graal.py --- a/mx/mx_graal.py Mon Feb 10 03:39:21 2014 +0000 +++ b/mx/mx_graal.py Mon Feb 10 13:51:20 2014 +0100 @@ -81,6 +81,8 @@ _minVersion = mx.VersionSpec('1.7.0_04') +JDK_UNIX_PERMISSIONS = 0755 + def _get_vm(): """ Gets the configured VM, presenting a dialogue if there is no currently configured VM. @@ -324,7 +326,7 @@ assert defaultVM is not None, 'Could not find default VM in ' + jvmCfg if mx.get_os() != 'windows': - chmodRecursive(jdk, 0755) + chmodRecursive(jdk, JDK_UNIX_PERMISSIONS) shutil.move(join(_vmLibDirInJdk(jdk), defaultVM), join(_vmLibDirInJdk(jdk), 'original')) @@ -402,7 +404,9 @@ fd, tmp = tempfile.mkstemp(suffix='', prefix='graal.jar', dir=jreLibDir) shutil.copyfile(graalJar, tmp) os.close(fd) - shutil.move(tmp, join(jreLibDir, 'graal.jar')) + graalJar = join(jreLibDir, 'graal.jar') + shutil.move(tmp, graalJar) + os.chmod(graalJar, JDK_UNIX_PERMISSIONS) # run a command in the windows SDK Debug Shell def _runInDebugShell(cmd, workingDir, logFile=None, findInOutput=None, respondTo=None): @@ -568,7 +572,7 @@ vmDir = join(_vmLibDirInJdk(jdk), vm) if not exists(vmDir): if mx.get_os() != 'windows': - chmodRecursive(jdk, 0755) + chmodRecursive(jdk, JDK_UNIX_PERMISSIONS) mx.log('Creating VM directory in JDK7: ' + vmDir) os.makedirs(vmDir) @@ -685,7 +689,7 @@ if not found: mx.log('Appending "' + prefix + 'KNOWN" to ' + jvmCfg) if mx.get_os() != 'windows': - os.chmod(jvmCfg, 0755) + os.chmod(jvmCfg, JDK_UNIX_PERMISSIONS) with open(jvmCfg, 'w') as f: for line in lines: if line.startswith(prefix):