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

Side by Side Diff: bin/cbuildbot.py

Issue 3159047: Fix case where there is nothing to uprev. (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Created 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | bin/cbuildbot_unittest.py » ('j') | 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/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """CBuildbot is wrapper around the build process used by the pre-flight queue""" 7 """CBuildbot is wrapper around the build process used by the pre-flight queue"""
8 8
9 import errno 9 import errno
10 import optparse 10 import optparse
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 # Might not have entry if no matching ebuild. 202 # Might not have entry if no matching ebuild.
203 if repo_dictionary.has_key(repo_name): 203 if repo_dictionary.has_key(repo_name):
204 # May be many corresponding packages to a given git repo e.g. kernel). 204 # May be many corresponding packages to a given git repo e.g. kernel).
205 for package in repo_dictionary[repo_name]: 205 for package in repo_dictionary[repo_name]:
206 revisions[package] = revision_tuple[1] 206 revisions[package] = revision_tuple[1]
207 return revisions.items() 207 return revisions.items()
208 208
209 209
210 def _UprevFromRevisionList(buildroot, revision_list): 210 def _UprevFromRevisionList(buildroot, revision_list):
211 """Uprevs based on revision list.""" 211 """Uprevs based on revision list."""
212 if not revision_list:
213 print >> sys.stderr, 'No packages found to uprev'
214 return
212 package_str = '' 215 package_str = ''
213 commit_str = '' 216 commit_str = ''
214 for package, revision in revision_list: 217 for package, revision in revision_list:
215 package_str += package + ' ' 218 package_str += package + ' '
216 commit_str += revision + ' ' 219 commit_str += revision + ' '
217 package_str = package_str.strip() 220 package_str = package_str.strip()
218 commit_str = commit_str.strip() 221 commit_str = commit_str.strip()
219 222
220 cwd = os.path.join(buildroot, 'src', 'scripts') 223 cwd = os.path.join(buildroot, 'src', 'scripts')
221 RunCommand(['./cros_mark_as_stable', 224 RunCommand(['./cros_mark_as_stable',
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 _UprevCleanup(buildroot) 380 _UprevCleanup(buildroot)
378 except: 381 except:
379 # something went wrong, cleanup (being paranoid) for next build 382 # something went wrong, cleanup (being paranoid) for next build
380 if clobber: 383 if clobber:
381 RunCommand(['sudo', 'rm', '-rf', buildroot], print_cmd=False) 384 RunCommand(['sudo', 'rm', '-rf', buildroot], print_cmd=False)
382 raise 385 raise
383 386
384 387
385 if __name__ == '__main__': 388 if __name__ == '__main__':
386 main() 389 main()
OLDNEW
« no previous file with comments | « no previous file | bin/cbuildbot_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698