Mercurial > hg > graal-jvmci-8
comparison mx/commands.py @ 6705:0cb1ac637dd0
Added recursive chmod for cases where JAVA_HOME is not owned by graal workspace owner.
author | Laurent Daynes <Laurent.Daynes@oracle.com> |
---|---|
date | Mon, 12 Nov 2012 13:04:08 +0100 |
parents | 602ee4d1db61 |
children | cce59a7ee92c |
comparison
equal
deleted
inserted
replaced
6704:4d6c13994690 | 6705:0cb1ac637dd0 |
---|---|
76 * questions. | 76 * questions. |
77 */ | 77 */ |
78 | 78 |
79 """ | 79 """ |
80 | 80 |
81 def _chmodDir(chmodFlags, dirname, fnames): | |
82 os.chmod(dirname, chmodFlags) | |
83 for file in fnames: | |
84 os.chmod(os.path.join(dirname, file), chmodFlags) | |
85 | |
86 def chmodRecursive(dirname, chmodFlags): | |
87 os.path.walk(dirname, _chmodDir, chmodFlags) | |
88 | |
81 def clean(args): | 89 def clean(args): |
82 """clean the GraalVM source tree""" | 90 """clean the GraalVM source tree""" |
83 opts = mx.clean(args, parser=ArgumentParser(prog='mx clean')) | 91 opts = mx.clean(args, parser=ArgumentParser(prog='mx clean')) |
84 if opts.native: | 92 if opts.native: |
85 os.environ.update(ARCH_DATA_MODEL='64', LANG='C', HOTSPOT_BUILD_JOBS='16') | 93 os.environ.update(ARCH_DATA_MODEL='64', LANG='C', HOTSPOT_BUILD_JOBS='16') |
347 lines.append('-' + defaultVM + '0 KNOWN\n') | 355 lines.append('-' + defaultVM + '0 KNOWN\n') |
348 lines.append(line) | 356 lines.append(line) |
349 | 357 |
350 assert defaultVM is not None, 'Could not find default VM in ' + jvmCfg | 358 assert defaultVM is not None, 'Could not find default VM in ' + jvmCfg |
351 if mx.get_os() != 'windows': | 359 if mx.get_os() != 'windows': |
352 os.chmod(_vmLibDirInJdk(jdk), 0755) | 360 chmodRecursive(jdk, 0755) |
353 os.chmod(jvmCfg, 0755) | |
354 shutil.copytree(join(_vmLibDirInJdk(jdk), defaultVM), join(_vmLibDirInJdk(jdk), defaultVM + '0')) | 361 shutil.copytree(join(_vmLibDirInJdk(jdk), defaultVM), join(_vmLibDirInJdk(jdk), defaultVM + '0')) |
355 | 362 |
356 with open(jvmCfg, 'w') as f: | 363 with open(jvmCfg, 'w') as f: |
357 for line in lines: | 364 for line in lines: |
358 f.write(line) | 365 f.write(line) |
463 jdk = _jdk(build, create=True) | 470 jdk = _jdk(build, create=True) |
464 | 471 |
465 vmDir = join(_vmLibDirInJdk(jdk), vm) | 472 vmDir = join(_vmLibDirInJdk(jdk), vm) |
466 if not exists(vmDir): | 473 if not exists(vmDir): |
467 if mx.get_os() != 'windows': | 474 if mx.get_os() != 'windows': |
468 os.chmod(_vmLibDirInJdk(jdk), 0755) | 475 chmodRecursive(jdk, 0755) |
469 mx.log('Creating VM directory in JDK7: ' + vmDir) | 476 mx.log('Creating VM directory in JDK7: ' + vmDir) |
470 os.makedirs(vmDir) | 477 os.makedirs(vmDir) |
471 | 478 |
472 def filterXusage(line): | 479 def filterXusage(line): |
473 if not 'Xusage.txt' in line: | 480 if not 'Xusage.txt' in line: |