OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license | 4 # Use of this source code is governed by a BSD-style license |
5 # that can be found in the LICENSE file in the root of the source | 5 # that can be found in the LICENSE file in the root of the source |
6 # tree. An additional intellectual property rights grant can be found | 6 # tree. An additional intellectual property rights grant can be found |
7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
9 | 9 |
10 """Script to download a Chromium checkout into the workspace. | 10 """Script to download a Chromium checkout into the workspace. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 repr(target_os_list), | 97 repr(target_os_list), |
98 ]) | 98 ]) |
99 if (os.path.exists(os.path.join(opts.chromium_dir, 'src')) and | 99 if (os.path.exists(os.path.join(opts.chromium_dir, 'src')) and |
100 os.path.exists(flag_file)): | 100 os.path.exists(flag_file)): |
101 with open(flag_file, 'r') as f: | 101 with open(flag_file, 'r') as f: |
102 if f.read() == flag_file_content: | 102 if f.read() == flag_file_content: |
103 print 'Chromium already up to date: ', opts.target_revision | 103 print 'Chromium already up to date: ', opts.target_revision |
104 return 0 | 104 return 0 |
105 os.unlink(flag_file) | 105 os.unlink(flag_file) |
106 | 106 |
107 env = os.environ.copy() | |
108 | |
109 # Workaround to avoid sync failure due move in | 107 # Workaround to avoid sync failure due move in |
110 # https://codereview.chromium.org/1155743013 | 108 # https://codereview.chromium.org/1155743013 |
111 # TODO(kjellander): Remove this after the summer of 2015. | 109 # TODO(kjellander): Remove this after the summer of 2015. |
112 freetype_src = os.path.join(CR_DIR, 'src', 'third_party', 'freetype-android', | 110 freetype_src = os.path.join(CR_DIR, 'src', 'third_party', 'freetype-android', |
113 'src') | 111 'src') |
114 if os.path.isdir(freetype_src): | 112 if os.path.isdir(freetype_src): |
115 shutil.rmtree(freetype_src) | 113 shutil.rmtree(freetype_src) |
116 | 114 |
117 # Avoid downloading NaCl toolchain as part of the Chromium hooks. | 115 # Avoid downloading NaCl toolchain as part of the Chromium hooks. |
118 env.setdefault('GYP_DEFINES', '') | |
119 env['GYP_DEFINES'] += ' disable_nacl=1' | |
120 env['GYP_CHROMIUM_NO_ACTION'] = '1' | |
121 gclient_cmd = 'gclient.bat' if sys.platform.startswith('win') else 'gclient' | 116 gclient_cmd = 'gclient.bat' if sys.platform.startswith('win') else 'gclient' |
122 args = [ | 117 args = [ |
123 gclient_cmd, 'sync', '--force', '--revision', 'src@'+opts.target_revision | 118 gclient_cmd, 'sync', '--force', '--revision', 'src@'+opts.target_revision |
124 ] | 119 ] |
125 | 120 |
126 if os.environ.get('CHROME_HEADLESS') == '1': | 121 if os.environ.get('CHROME_HEADLESS') == '1': |
127 # Running on a buildbot. | 122 # Running on a buildbot. |
128 args.append('-vvv') | 123 args.append('-vvv') |
129 | 124 |
130 if sys.platform.startswith('win'): | 125 if sys.platform.startswith('win'): |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 args += ['--deps=' + target_os_list] | 171 args += ['--deps=' + target_os_list] |
177 | 172 |
178 print textwrap.dedent("""\ | 173 print textwrap.dedent("""\ |
179 +---------------------------------------------------------------------+ | 174 +---------------------------------------------------------------------+ |
180 | NOTICE: This sync of Chromium will take a long time as several | | 175 | NOTICE: This sync of Chromium will take a long time as several | |
181 | gigabytes of data are downloaded. If this is your initial | | 176 | gigabytes of data are downloaded. If this is your initial | |
182 | sync and it's interrupted, try running 'gclient sync' again.| | 177 | sync and it's interrupted, try running 'gclient sync' again.| |
183 | If that fails, wipe everything clean and start over again. | | 178 | If that fails, wipe everything clean and start over again. | |
184 +---------------------------------------------------------------------+""") | 179 +---------------------------------------------------------------------+""") |
185 print 'Running "%s" in %s' % (' '.join(args), opts.chromium_dir) | 180 print 'Running "%s" in %s' % (' '.join(args), opts.chromium_dir) |
186 ret = subprocess.call(args, cwd=opts.chromium_dir, env=env) | 181 ret = subprocess.call(args, cwd=opts.chromium_dir) |
187 if ret == 0: | 182 if ret == 0: |
188 with open(flag_file, 'wb') as f: | 183 with open(flag_file, 'wb') as f: |
189 f.write(flag_file_content) | 184 f.write(flag_file_content) |
190 | 185 |
191 return ret | 186 return ret |
192 | 187 |
193 | 188 |
194 if __name__ == '__main__': | 189 if __name__ == '__main__': |
195 sys.exit(main()) | 190 sys.exit(main()) |
OLD | NEW |