Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: scripts/slave/bot_update.py

Issue 552763002: Teach bot_update to support patching deps in solutions other than the patch_root (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 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 # TODO(hinoka): Use logging. 6 # TODO(hinoka): Use logging.
7 7
8 import cStringIO 8 import cStringIO
9 import codecs 9 import codecs
10 import collections 10 import collections
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 # Get a checkout of each solution, without DEPS or hooks. 1250 # Get a checkout of each solution, without DEPS or hooks.
1251 # Calling git directly because there is no way to run Gclient without 1251 # Calling git directly because there is no way to run Gclient without
1252 # invoking DEPS. 1252 # invoking DEPS.
1253 print 'Fetching Git checkout' 1253 print 'Fetching Git checkout'
1254 git_ref = git_checkout(solutions, revisions, shallow, with_branch_heads) 1254 git_ref = git_checkout(solutions, revisions, shallow, with_branch_heads)
1255 1255
1256 patches = None 1256 patches = None
1257 if patch_url: 1257 if patch_url:
1258 patches = get_svn_patch(patch_url) 1258 patches = get_svn_patch(patch_url)
1259 1259
1260 for solution in solutions: 1260 for solution in solutions:
kjellander_chromium 2014/09/08 14:14:23 Please add a blacklist to be used when patching th
agable 2014/09/08 18:23:24 Acknowledged.
1261 # At first, only patch top-level DEPS. 1261 if (patch_root == solution['name'] or
1262 if patch_root == solution['name']: 1262 solution['name'].startswith(patch_root + '/')):
1263 relative_root = solution['name'][len(patch_root) + 1:]
1264 target = '/'.join(relative_root, 'DEPS').lstrip('/')
kjellander_chromium 2014/09/08 14:14:23 This needs to be target = '/'.join([relative_root,
agable 2014/09/08 18:23:24 Done.
1263 if patches: 1265 if patches:
kjellander_chromium 2014/09/08 14:14:23 Add blacklist.append(target) somewhere around here
agable 2014/09/08 18:23:24 Acknowledged.
1264 apply_svn_patch(patch_root, patches, whitelist=['DEPS']) 1266 apply_svn_patch(patch_root, patches, whitelist=[target])
1265 elif issue: 1267 elif issue:
1266 apply_rietveld_issue(issue, patchset, patch_root, rietveld_server, 1268 apply_rietveld_issue(issue, patchset, patch_root, rietveld_server,
1267 revision_mapping, git_ref, whitelist=['DEPS']) 1269 revision_mapping, git_ref, whitelist=[target])
1268 break
1269 1270
1270 if buildspec: 1271 if buildspec:
1271 buildspecs2git(first_sln, buildspec) 1272 buildspecs2git(first_sln, buildspec)
1272 else: 1273 else:
1273 # Run deps2git if there is a DEPS change after the last .DEPS.git commit. 1274 # Run deps2git if there is a DEPS change after the last .DEPS.git commit.
1274 for solution in solutions: 1275 for solution in solutions:
1275 ensure_deps2git(solution, shallow) 1276 ensure_deps2git(solution, shallow)
1276 1277
1277 # Ensure our build/ directory is set up with the correct .gclient file. 1278 # Ensure our build/ directory is set up with the correct .gclient file.
1278 gclient_configure(solutions, target_os, target_os_only) 1279 gclient_configure(solutions, target_os, target_os_only)
(...skipping 12 matching lines...) Expand all
1291 # TODO(hinoka): Remove this when the official builders run their own 1292 # TODO(hinoka): Remove this when the official builders run their own
1292 # runhooks step. 1293 # runhooks step.
1293 gclient_runhooks(gyp_env) 1294 gclient_runhooks(gyp_env)
1294 1295
1295 # Finally, ensure that all DEPS are pinned to the correct revision. 1296 # Finally, ensure that all DEPS are pinned to the correct revision.
1296 dir_names = [sln['name'] for sln in solutions] 1297 dir_names = [sln['name'] for sln in solutions]
1297 ensure_deps_revisions(gclient_output.get('solutions', {}), 1298 ensure_deps_revisions(gclient_output.get('solutions', {}),
1298 dir_names, revisions) 1299 dir_names, revisions)
1299 # Apply the rest of the patch here (sans DEPS) 1300 # Apply the rest of the patch here (sans DEPS)
1300 if patches: 1301 if patches:
1301 apply_svn_patch(patch_root, patches, blacklist=['DEPS']) 1302 apply_svn_patch(patch_root, patches, blacklist=['DEPS'])
kjellander_chromium 2014/09/08 14:14:23 blacklist=blacklist here and below.
agable 2014/09/08 18:23:24 Done.
1302 elif issue: 1303 elif issue:
1303 apply_rietveld_issue(issue, patchset, patch_root, rietveld_server, 1304 apply_rietveld_issue(issue, patchset, patch_root, rietveld_server,
1304 revision_mapping, git_ref, blacklist=['DEPS']) 1305 revision_mapping, git_ref, blacklist=['DEPS'])
1305 1306
1306 # Reset the deps_file point in the solutions so that hooks get run properly. 1307 # Reset the deps_file point in the solutions so that hooks get run properly.
1307 for sln in solutions: 1308 for sln in solutions:
1308 sln['deps_file'] = sln.get('deps_file', 'DEPS').replace('.DEPS.git', 'DEPS') 1309 sln['deps_file'] = sln.get('deps_file', 'DEPS').replace('.DEPS.git', 'DEPS')
1309 gclient_configure(solutions, target_os, target_os_only) 1310 gclient_configure(solutions, target_os, target_os_only)
1310 1311
1311 return gclient_output 1312 return gclient_output
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 except Exception: 1637 except Exception:
1637 # Unexpected failure. 1638 # Unexpected failure.
1638 emit_flag(options.flag_file) 1639 emit_flag(options.flag_file)
1639 raise 1640 raise
1640 else: 1641 else:
1641 emit_flag(options.flag_file) 1642 emit_flag(options.flag_file)
1642 1643
1643 1644
1644 if __name__ == '__main__': 1645 if __name__ == '__main__':
1645 sys.exit(main()) 1646 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698