comparison mx/mx_graal.py @ 16863:0d2e3399acfe

mx: add argument for permissions to copyToJdk()
author Danilo Ansaloni <danilo.ansaloni@oracle.com>
date Tue, 19 Aug 2014 17:30:28 +0200
parents bf499b4d86e9
children 73d994651fcd
comparison
equal deleted inserted replaced
16862:bf499b4d86e9 16863:0d2e3399acfe
544 zf.writestr(os.path.basename(javaClass), fp.read()) 544 zf.writestr(os.path.basename(javaClass), fp.read())
545 zf.close() 545 zf.close()
546 os.unlink(javaSource) 546 os.unlink(javaSource)
547 os.unlink(javaClass) 547 os.unlink(javaClass)
548 548
549 def _copyToJdk(src, dst): 549 def _copyToJdk(src, dst, permissions=JDK_UNIX_PERMISSIONS_FILE):
550 name = os.path.basename(src) 550 name = os.path.basename(src)
551 dstLib = join(dst, name) 551 dstLib = join(dst, name)
552 if mx.get_env('SYMLINK_GRAAL_JAR', None) == 'true': 552 if mx.get_env('SYMLINK_GRAAL_JAR', None) == 'true':
553 # Using symlinks is much faster than copying but may 553 # Using symlinks is much faster than copying but may
554 # cause issues if the lib is being updated while 554 # cause issues if the lib is being updated while
561 # do a copy and then a move to get atomic updating (on Unix) 561 # do a copy and then a move to get atomic updating (on Unix)
562 fd, tmp = tempfile.mkstemp(suffix='', prefix=name, dir=dst) 562 fd, tmp = tempfile.mkstemp(suffix='', prefix=name, dir=dst)
563 shutil.copyfile(src, tmp) 563 shutil.copyfile(src, tmp)
564 os.close(fd) 564 os.close(fd)
565 shutil.move(tmp, dstLib) 565 shutil.move(tmp, dstLib)
566 os.chmod(dstLib, JDK_UNIX_PERMISSIONS_FILE) 566 os.chmod(dstLib, permissions)
567
568 def _installDistInJdksExt(dist):
569 _installDistInJdks(dist, True)
570 567
571 def _installDistInJdks(dist, ext=False): 568 def _installDistInJdks(dist, ext=False):
572 """ 569 """
573 Installs the jar(s) for a given Distribution into all existing Graal JDKs 570 Installs the jar(s) for a given Distribution into all existing Graal JDKs
574 """ 571 """