OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Automates running BuildPackageLists, BuildSysroot, and | 6 """Automates running BuildPackageLists, BuildSysroot, and |
7 UploadSysroot for each supported arch of each sysroot creator. | 7 UploadSysroot for each supported arch of each sysroot creator. |
8 """ | 8 """ |
9 | 9 |
10 import glob | 10 import glob |
(...skipping 26 matching lines...) Expand all Loading... |
37 def build_and_upload(script_path, distro, release, arch, lock): | 37 def build_and_upload(script_path, distro, release, arch, lock): |
38 # TODO(thomasanderson): Find out which revision 'git-cl upload' uses to | 38 # TODO(thomasanderson): Find out which revision 'git-cl upload' uses to |
39 # calculate the diff against and use that instead of HEAD. | 39 # calculate the diff against and use that instead of HEAD. |
40 script_dir = os.path.dirname(os.path.realpath(__file__)) | 40 script_dir = os.path.dirname(os.path.realpath(__file__)) |
41 revision = get_proc_output(['git', '-C', script_dir, 'rev-parse', 'HEAD']) | 41 revision = get_proc_output(['git', '-C', script_dir, 'rev-parse', 'HEAD']) |
42 | 42 |
43 run_script([script_path, 'UpdatePackageLists%s' % arch]) | 43 run_script([script_path, 'UpdatePackageLists%s' % arch]) |
44 run_script([script_path, 'BuildSysroot%s' % arch]) | 44 run_script([script_path, 'BuildSysroot%s' % arch]) |
45 run_script([script_path, 'UploadSysroot%s' % arch, revision]) | 45 run_script([script_path, 'UploadSysroot%s' % arch, revision]) |
46 | 46 |
47 tarball = '%s_%s_%s_sysroot.tgz' % (distro, release, arch.lower()) | 47 tarball = '%s_%s_%s_sysroot.tar.xz' % (distro, release, arch.lower()) |
48 tgz_path = os.path.join(script_dir, "..", "..", "..", "out", "sysroot-build", | 48 tarxz_path = os.path.join(script_dir, "..", "..", "..", "out", |
49 release, tarball) | 49 "sysroot-build", release, tarball) |
50 sha1sum = sha1sumfile(tgz_path) | 50 sha1sum = sha1sumfile(tarxz_path) |
51 sysroot_dir = '%s_%s_%s-sysroot' % (distro, release, arch.lower()) | 51 sysroot_dir = '%s_%s_%s-sysroot' % (distro, release, arch.lower()) |
52 | 52 |
53 sysroot_metadata = { | 53 sysroot_metadata = { |
54 'Revision': revision, | 54 'Revision': revision, |
55 'Tarball': tarball, | 55 'Tarball': tarball, |
56 'Sha1Sum': sha1sum, | 56 'Sha1Sum': sha1sum, |
57 'SysrootDir': sysroot_dir | 57 'SysrootDir': sysroot_dir |
58 } | 58 } |
59 with lock: | 59 with lock: |
60 with open(os.path.join(script_dir, 'sysroots.json'), 'rw+') as f: | 60 with open(os.path.join(script_dir, 'sysroots.json'), 'rw+') as f: |
(...skipping 27 matching lines...) Expand all Loading... |
88 failures = 0 | 88 failures = 0 |
89 for name, proc in procs: | 89 for name, proc in procs: |
90 if proc.exitcode: | 90 if proc.exitcode: |
91 failures += 1 | 91 failures += 1 |
92 status = "FAILURE" if proc.exitcode else "SUCCESS" | 92 status = "FAILURE" if proc.exitcode else "SUCCESS" |
93 print "%s sysroot creation\t%s" % (name, status) | 93 print "%s sysroot creation\t%s" % (name, status) |
94 return failures | 94 return failures |
95 | 95 |
96 if __name__ == '__main__': | 96 if __name__ == '__main__': |
97 sys.exit(main()) | 97 sys.exit(main()) |
OLD | NEW |