From 564373521e0cc2b7daa266a4a48e5d585a75d6cb Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Mon, 29 Nov 2010 10:42:49 -0800 Subject: [PATCH] Reconfigure to use ssh connection rather than use different manifest. This also removes the rw_checkout var as it's not longer changes the affect of whether we use the ssh url or not. Note that this replaces the other CL from last night because the other CL didn't work. The other CL still pulled in the same manifest that has http: url's for each git repo. I reverted that change last night after I noticed this. Change-Id: I3d4ad2be6887ac2cf4ed2009bad9cae6dfdf5bbf BUG=chromium-os:9509 TEST=Ran with cbuildbot --clobber and incremental Review URL: http://codereview.chromium.org/5278010 --- bin/cbuildbot.py | 23 ++++++++--------------- bin/cros_repo_sync_all.py | 6 +++--- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py index 14cfa99487..f6258d12fc 100755 --- a/bin/cbuildbot.py +++ b/bin/cbuildbot.py @@ -45,27 +45,21 @@ def MakeDir(path, parents=False): raise -def RepoSync(buildroot, rw_checkout=False, retries=_DEFAULT_RETRIES): +def RepoSync(buildroot, retries=_DEFAULT_RETRIES): """Uses repo to checkout the source code. Keyword arguments: - rw_checkout -- Reconfigure repo after sync'ing to read-write. retries -- Number of retries to try before failing on the sync. - """ while retries > 0: try: # The --trace option ensures that repo shows the output from git. This # is needed so that the buildbot can kill us if git is not making # progress. + RunCommand(['repo', 'forall', '-c', 'git', 'config', + 'url.ssh://git@gitrw.chromium.org:9222.insteadof', + 'http://git.chromium.org/git'], cwd=buildroot) RunCommand(['repo', '--trace', 'sync'], cwd=buildroot) - if rw_checkout: - # Always re-run in case of new git repos or repo sync - # failed in a previous run because of a forced Stop Build. - RunCommand(['repo', 'forall', '-c', 'git', 'config', - 'url.ssh://git@gitrw.chromium.org:9222.pushinsteadof', - 'http://git.chromium.org/git'], cwd=buildroot) - retries = 0 except: retries -= 1 @@ -287,7 +281,7 @@ def _PreFlightRinse(buildroot, board, tracking_branch, overlays): RunCommand(['sudo', 'killall', 'kvm'], error_ok=True) -def _FullCheckout(buildroot, tracking_branch, rw_checkout=True, +def _FullCheckout(buildroot, tracking_branch, retries=_DEFAULT_RETRIES, url='http://git.chromium.org/git/manifest'): """Performs a full checkout and clobbers any previous checkouts.""" @@ -297,13 +291,12 @@ def _FullCheckout(buildroot, tracking_branch, rw_checkout=True, RunCommand(['repo', 'init', '-u', url, '-b', '%s' % branch[-1]], cwd=buildroot, input='\n\ny\n') - RepoSync(buildroot, rw_checkout, retries) + RepoSync(buildroot, retries) -def _IncrementalCheckout(buildroot, rw_checkout=True, - retries=_DEFAULT_RETRIES): +def _IncrementalCheckout(buildroot, retries=_DEFAULT_RETRIES): """Performs a checkout without clobbering previous checkout.""" - RepoSync(buildroot, rw_checkout, retries) + RepoSync(buildroot, retries) def _MakeChroot(buildroot): diff --git a/bin/cros_repo_sync_all.py b/bin/cros_repo_sync_all.py index 6203b5a60d..642ef06fb4 100755 --- a/bin/cros_repo_sync_all.py +++ b/bin/cros_repo_sync_all.py @@ -26,10 +26,10 @@ def main(): if options.buildroot: if options.clobber: cbuildbot._FullCheckout(options.buildroot, options.tracking_branch, - rw_checkout=False, retries=_NUMBER_OF_RETRIES) + retries=_NUMBER_OF_RETRIES) else: - cbuildbot._IncrementalCheckout(options.buildroot, rw_checkout=False, - retries=_NUMBER_OF_RETRIES) + cbuildbot._IncrementalCheckout(options.buildroot, + retries=_NUMBER_OF_RETRIES) else: print >> sys.stderr, 'ERROR: Must set buildroot' sys.exit(1)