| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 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 # Common constants for build scripts | 5 # Common constants for build scripts |
| 6 # This must evaluate properly for both /bin/bash and /bin/sh | 6 # This must evaluate properly for both /bin/bash and /bin/sh |
| 7 | 7 |
| 8 # All scripts should die on error unless commands are specifically excepted | 8 # All scripts should die on error unless commands are specifically excepted |
| 9 # by prefixing with '!' or surrounded by 'set +e' / 'set -e'. | 9 # by prefixing with '!' or surrounded by 'set +e' / 'set -e'. |
| 10 # TODO: Re-enable this once shflags is less prone to dying. | 10 # TODO: Re-enable this once shflags is less prone to dying. |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 if [[ $# -gt 0 ]]; then | 273 if [[ $# -gt 0 ]]; then |
| 274 echo "error: invalid arguments: \"$@\"" >&2 | 274 echo "error: invalid arguments: \"$@\"" >&2 |
| 275 flags_help | 275 flags_help |
| 276 exit 1 | 276 exit 1 |
| 277 fi | 277 fi |
| 278 return $do_shift | 278 return $do_shift |
| 279 } | 279 } |
| 280 | 280 |
| 281 V_RED="\e[31m" | 281 V_RED="\e[31m" |
| 282 V_YELLOW="\e[33m" | 282 V_YELLOW="\e[33m" |
| 283 V_BOLD_RED="\e[1;31m" |
| 284 V_BOLD_YELLOW="\e[1;33m" |
| 283 | 285 |
| 284 function warn { | 286 function warn { |
| 285 echo -e "${V_YELLOW}Warning..: $1${V_VIDOFF}" | 287 echo -e "${V_BOLD_YELLOW}WARNING: $1${V_VIDOFF}" |
| 286 } | 288 } |
| 287 | 289 |
| 288 function error { | 290 function error { |
| 289 echo -e "${V_RED}Error....: $1${V_VIDOFF}" | 291 echo -e "${V_BOLD_RED}ERROR : $1${V_VIDOFF}" |
| 290 } | 292 } |
| 291 | 293 |
| 292 function die { | 294 function die { |
| 293 error "$1" | 295 error "$1" |
| 294 exit 1 | 296 exit 1 |
| 295 } | 297 } |
| OLD | NEW |