| OLD | NEW |
| 1 # Copyright 2012 Google Inc. All Rights Reserved. | 1 # Copyright 2012 Google Inc. All Rights Reserved. |
| 2 | 2 |
| 3 import os | 3 import os |
| 4 import platform | 4 import platform |
| 5 import shutil | 5 import shutil |
| 6 import stat | 6 import stat |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 HOME = os.path.dirname(os.path.realpath(__file__)) | 9 HOME = os.path.dirname(os.path.realpath(__file__)) |
| 10 HOME = os.path.join(HOME, os.pardir, os.pardir) | 10 HOME = os.path.join(HOME, os.pardir, os.pardir) |
| 11 BUILDER_NAME = os.environ.get('BUILDBOT_BUILDERNAME') | 11 BUILDER_NAME = os.environ.get('BUILDBOT_BUILDERNAME') |
| 12 | 12 |
| 13 END_SCRIPT = ''' | 13 END_SCRIPT = ''' |
| 14 VM = '%s' | 14 VM = '%s' |
| 15 D8 = '%s' | 15 D8 = '%s' |
| 16 HOME = '%s' | |
| 17 if __name__ == '__main__': | 16 if __name__ == '__main__': |
| 18 sys.exit(main(sys.argv)) | 17 sys.exit(main(sys.argv)) |
| 19 ''' | 18 ''' |
| 20 | 19 |
| 21 def main(args): | 20 def main(args): |
| 22 product_dir = args[1] | 21 product_dir = args[1] |
| 23 vm = os.path.join(product_dir, 'dart') | 22 vm = os.path.join(product_dir, 'dart') |
| 24 d8 = os.path.join(product_dir, 'd8') | 23 d8 = os.path.join(product_dir, 'd8') |
| 25 id = platform.system() | 24 id = platform.system() |
| 26 if id == 'Windows' or id == 'Microsoft': | 25 if id == 'Windows' or id == 'Microsoft': |
| 27 vm = vm + '.exe' | 26 vm = vm + '.exe' |
| 28 frog = os.path.join(product_dir, 'frog', 'bin', 'frog') | 27 frog = os.path.join(product_dir, 'frog', 'bin', 'frog') |
| 29 | 28 |
| 30 shutil.copy(os.path.join(HOME, 'scripts', 'bootstrap', 'frog_wrapper.py'), | 29 shutil.copy(os.path.join(HOME, 'scripts', 'bootstrap', 'frog_wrapper.py'), |
| 31 frog) | 30 frog) |
| 32 shutil.copy(os.path.join(HOME, 'scripts', 'bootstrap', 'frog.bat'), | 31 shutil.copy(os.path.join(HOME, 'scripts', 'bootstrap', 'frog.bat'), |
| 33 frog + '.bat') | 32 frog + '.bat') |
| 34 | 33 |
| 35 with open(frog, 'a+') as f: | 34 with open(frog, 'a+') as f: |
| 36 f.write(END_SCRIPT % (vm, d8, HOME)) | 35 f.write(END_SCRIPT % (vm, d8)) |
| 37 | 36 |
| 38 os.chmod(frog, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR | | 37 os.chmod(frog, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR | |
| 39 stat.S_IRGRP | stat.S_IWUSR) | 38 stat.S_IRGRP | stat.S_IWUSR) |
| 40 return 0 | 39 return 0 |
| 41 | 40 |
| 42 | 41 |
| 43 if __name__ == '__main__': | 42 if __name__ == '__main__': |
| 44 sys.exit(main(sys.argv)) | 43 sys.exit(main(sys.argv)) |
| OLD | NEW |