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

Unified Diff: bin/cbuildbot.py

Issue 3137006: Add some information to cbuildbot output. (Closed) Base URL: http://src.chromium.org/git/crosutils.git
Patch Set: Add copyrights Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | bin/cbuildbot_config.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cbuildbot.py
diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py
index 046ba2c11d5a4052b522104cf9192c721f20d36f..5bcb04788006c4fa7d907b151666c4a66ceb11fd 100755
--- a/bin/cbuildbot.py
+++ b/bin/cbuildbot.py
@@ -1,10 +1,15 @@
#!/usr/bin/python
+# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
import errno
import optparse
import os
import shutil
import subprocess
+import sys
from cbuildbot_config import config
@@ -13,8 +18,8 @@ from cbuildbot_config import config
def RunCommand(cmd, error_ok=False, error_message=None, exit_code=False,
redirect_stdout=False, redirect_stderr=False, cwd=None,
input=None):
- # Useful for debugging:
- # print >>sys.stderr, "RunCommand:", ' '.join(cmd)
+ # Print out the command before running.
+ print >>sys.stderr, "CBUILDBOT -- RunCommand:", ' '.join(cmd)
if redirect_stdout:
stdout = subprocess.PIPE
else:
@@ -104,7 +109,8 @@ def _GetConfig(config_name):
def main():
# Parse options
- parser = optparse.OptionParser()
+ usage = "usage: %prog [options] cbuildbot_config"
+ parser = optparse.OptionParser(usage=usage)
parser.add_option('-r', '--buildroot',
help='root directory where build occurs', default=".")
parser.add_option('-n', '--buildnumber',
@@ -112,8 +118,12 @@ def main():
(options, args) = parser.parse_args()
buildroot = options.buildroot
- buildconfig = _GetConfig(args[0])
-
+ if len(args) == 1:
+ buildconfig = _GetConfig(args[0])
+ else:
+ print >>sys.stderr, "Missing configuration description"
+ parser.print_usage()
+ sys.exit(1)
try:
if not os.path.isdir(buildroot):
_FullCheckout(buildroot)
« no previous file with comments | « no previous file | bin/cbuildbot_config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698