Chromium Code Reviews| Index: cros_mark_as_stable.py |
| diff --git a/cros_mark_as_stable.py b/cros_mark_as_stable.py |
| index 56a589c68214d2485ea7ec123a02e382a4ecfce0..10578e39167b3b1fb8852d774da3122c37343865 100755 |
| --- a/cros_mark_as_stable.py |
| +++ b/cros_mark_as_stable.py |
| @@ -22,10 +22,10 @@ from cros_build_lib import Info, RunCommand, Warning, Die |
| gflags.DEFINE_string('board', '', |
| 'Board for which the package belongs.', short_name='b') |
| gflags.DEFINE_string('overlays', '', |
| - 'Space separated list of overlays to modify.', |
| + 'Colon-separated list of overlays to modify.', |
| short_name='o') |
| gflags.DEFINE_string('packages', '', |
| - 'Space separated list of packages to mark as stable.', |
| + 'Colon-separated list of packages to mark as stable.', |
| short_name='p') |
| gflags.DEFINE_string('push_options', '', |
| 'Options to use with git-cl push using push command.') |
| @@ -245,7 +245,10 @@ def _SimpleRunCommand(command): |
| """Runs a shell command and returns stdout back to caller.""" |
| _Print(' + %s' % command) |
| proc_handle = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) |
| - return proc_handle.communicate()[0] |
| + stdout = proc_handle.communicate()[0] |
| + retcode = proc_handle.wait() |
| + assert retcode == 0, "Return code %s for command: %s" % (retcode, command) |
|
scottz-goog
2010/11/10 23:48:14
Assert are good for debugging but generally if you
|
| + return stdout |
| # ======================= End Global Helper Functions ======================== |
| @@ -487,11 +490,16 @@ def main(argv): |
| except gflags.FlagsError, e : |
| _PrintUsageAndDie(str(e)) |
| - package_list = gflags.FLAGS.packages.split() |
| + package_list = gflags.FLAGS.packages.split(':') |
| _CheckSaneArguments(package_list, command) |
| if gflags.FLAGS.overlays: |
| - overlays = dict((path, []) for path in gflags.FLAGS.overlays.split()) |
| + overlays = {} |
| + for path in gflags.FLAGS.overlays.split(':'): |
| + if not os.path.exists(path): |
| + Die('Cannot find overlay: %s' % path) |
| + overlays[path] = [] |
| else: |
| + Warning('Missing --overlays argument') |
| overlays = { |
| '%s/private-overlays/chromeos-overlay' % gflags.FLAGS.srcroot: [], |
| '%s/third_party/chromiumos-overlay' % gflags.FLAGS.srcroot: [] |