Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Module containing the various individual commands a builder can run.""" | 5 """Module containing the various individual commands a builder can run.""" |
| 6 | 6 |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 import shutil | 9 import shutil |
| 10 import sys | 10 import sys |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 | 111 |
| 112 # =========================== Main Commands =================================== | 112 # =========================== Main Commands =================================== |
| 113 | 113 |
| 114 def PreFlightRinse(buildroot, board, tracking_branch, overlays): | 114 def PreFlightRinse(buildroot, board, tracking_branch, overlays): |
| 115 """Cleans up any leftover state from previous runs.""" | 115 """Cleans up any leftover state from previous runs.""" |
| 116 _GitCleanup(buildroot, board, tracking_branch, overlays) | 116 _GitCleanup(buildroot, board, tracking_branch, overlays) |
| 117 _CleanUpMountPoints(buildroot) | 117 _CleanUpMountPoints(buildroot) |
| 118 cros_lib.OldRunCommand(['sudo', 'killall', 'kvm'], error_ok=True) | 118 cros_lib.OldRunCommand(['sudo', 'killall', 'kvm'], error_ok=True) |
| 119 | 119 |
| 120 | 120 |
| 121 def ManifestCheckout(buildroot, tracking_branch, next_version, | |
| 122 retries=_DEFAULT_RETRIES, | |
| 123 url='ssh://git.chromium.org:9222/manifest-versions'): | |
| 124 """Performs a manifest checkout and clobbers any previous checkouts.""" | |
| 125 | |
| 126 print "buildroot %s" % buildroot | |
| 127 print "tracking_branch %s" % tracking_branch | |
| 128 print "nextversion %s" % next_version | |
| 129 print "url %s" % url | |
| 130 | |
| 131 # Assume url is coming in and overriding and set to manifest-versions | |
| 132 url = os.path.dirname(url) + '/manifest-versions'; | |
| 133 | |
| 134 branch = tracking_branch.split('/'); | |
| 135 next_version_subdir = next_version.split('.'); | |
| 136 | |
| 137 manifest = os.path.join( | |
| 138 'buildspecs', | |
| 139 next_version_subdir[0] + '.' + next_version_subdir[1], | |
| 140 next_version + '.xml') | |
| 141 | |
| 142 #print 'MANIFEST:' + manifest; | |
|
sosa
2011/04/11 23:34:01
commented out?
dgarrett
2011/04/12 23:21:56
Removed.
| |
| 143 | |
| 144 cros_lib.OldRunCommand(['repo', 'init', '-u', url, '-m', manifest ], | |
| 145 cwd=buildroot, input='\n\ny\n') | |
| 146 _RepoSync(buildroot, retries) | |
| 147 | |
| 148 | |
| 121 def FullCheckout(buildroot, tracking_branch, | 149 def FullCheckout(buildroot, tracking_branch, |
| 122 retries=_DEFAULT_RETRIES, | 150 retries=_DEFAULT_RETRIES, |
| 123 url='http://git.chromium.org/git/manifest'): | 151 url='http://git.chromium.org/git/manifest'): |
| 124 """Performs a full checkout and clobbers any previous checkouts.""" | 152 """Performs a full checkout and clobbers any previous checkouts.""" |
| 125 _CleanUpMountPoints(buildroot) | 153 _CleanUpMountPoints(buildroot) |
| 126 cros_lib.OldRunCommand(['sudo', 'rm', '-rf', buildroot]) | 154 cros_lib.OldRunCommand(['sudo', 'rm', '-rf', buildroot]) |
| 127 os.makedirs(buildroot) | 155 os.makedirs(buildroot) |
| 128 branch = tracking_branch.split('/'); | 156 branch = tracking_branch.split('/'); |
| 129 cros_lib.OldRunCommand(['repo', 'init', '-q', '-u', url, '-b', | 157 cros_lib.OldRunCommand(['repo', 'init', '-q', '-u', url, '-b', |
| 130 '%s' % branch[-1]], cwd=buildroot, input='\n\ny\n') | 158 '%s' % branch[-1]], cwd=buildroot, input='\n\ny\n') |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 444 | 472 |
| 445 archive_url = None | 473 archive_url = None |
| 446 key_re = re.compile('^%s=(.*)$' % _CROS_ARCHIVE_URL) | 474 key_re = re.compile('^%s=(.*)$' % _CROS_ARCHIVE_URL) |
| 447 for line in result.output.splitlines(): | 475 for line in result.output.splitlines(): |
| 448 line_match = key_re.match(line) | 476 line_match = key_re.match(line) |
| 449 if line_match: | 477 if line_match: |
| 450 archive_url = line_match.group(1) | 478 archive_url = line_match.group(1) |
| 451 | 479 |
| 452 assert archive_url, 'Archive Build Failed to Provide Archive URL' | 480 assert archive_url, 'Archive Build Failed to Provide Archive URL' |
| 453 return archive_url | 481 return archive_url |
| OLD | NEW |