Mercurial > hg > graal-compiler
comparison mx/commands.py @ 6688:806821a1c0a8
Make sure files in copy of JDK has write-protection unset before modifying it.
author | Laurent Daynes <Laurent.Daynes@oracle.com> |
---|---|
date | Wed, 24 Oct 2012 12:59:22 +0200 |
parents | a9a50f21e000 |
children | 9611d0ccb4ec |
comparison
equal
deleted
inserted
replaced
6687:a9a50f21e000 | 6688:806821a1c0a8 |
---|---|
348 lines.append(line) | 348 lines.append(line) |
349 | 349 |
350 assert defaultVM is not None, 'Could not find default VM in ' + jvmCfg | 350 assert defaultVM is not None, 'Could not find default VM in ' + jvmCfg |
351 if mx.get_os() != 'windows': | 351 if mx.get_os() != 'windows': |
352 os.chmod(_vmLibDirInJdk(jdk), 0755) | 352 os.chmod(_vmLibDirInJdk(jdk), 0755) |
353 os.chmod(jvmCfg, 0755) | |
353 shutil.copytree(join(_vmLibDirInJdk(jdk), defaultVM), join(_vmLibDirInJdk(jdk), defaultVM + '0')) | 354 shutil.copytree(join(_vmLibDirInJdk(jdk), defaultVM), join(_vmLibDirInJdk(jdk), defaultVM + '0')) |
354 | 355 |
355 with open(jvmCfg, 'w') as f: | 356 with open(jvmCfg, 'w') as f: |
356 for line in lines: | 357 for line in lines: |
357 f.write(line) | 358 f.write(line) |
567 if not line.startswith(prefix): | 568 if not line.startswith(prefix): |
568 lines.append(line) | 569 lines.append(line) |
569 if not found: | 570 if not found: |
570 mx.log('Appending "' + prefix + ' KNOWN" to ' + jvmCfg) | 571 mx.log('Appending "' + prefix + ' KNOWN" to ' + jvmCfg) |
571 lines.append(vmKnown) | 572 lines.append(vmKnown) |
573 if mx.get_os() != 'windows': | |
574 os.chmod(jvmCfg, 0755) | |
572 with open(jvmCfg, 'w') as f: | 575 with open(jvmCfg, 'w') as f: |
573 for line in lines: | 576 for line in lines: |
574 f.write(line) | 577 f.write(line) |
575 | 578 |
576 if exists(timestampFile): | 579 if exists(timestampFile): |