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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 if [[ $# -gt 0 ]]; then | 296 if [[ $# -gt 0 ]]; then |
297 echo "error: invalid arguments: \"$@\"" >&2 | 297 echo "error: invalid arguments: \"$@\"" >&2 |
298 flags_help | 298 flags_help |
299 exit 1 | 299 exit 1 |
300 fi | 300 fi |
301 return $do_shift | 301 return $do_shift |
302 } | 302 } |
303 | 303 |
304 V_RED="\e[31m" | 304 V_RED="\e[31m" |
305 V_YELLOW="\e[33m" | 305 V_YELLOW="\e[33m" |
| 306 V_BOLD_GREEN="\e[1;32m" |
306 V_BOLD_RED="\e[1;31m" | 307 V_BOLD_RED="\e[1;31m" |
307 V_BOLD_YELLOW="\e[1;33m" | 308 V_BOLD_YELLOW="\e[1;33m" |
308 | 309 |
| 310 function info { |
| 311 echo -e "${V_BOLD_GREEN}INFO : $1${V_VIDOFF}" |
| 312 } |
| 313 |
309 function warn { | 314 function warn { |
310 echo -e "${V_BOLD_YELLOW}WARNING: $1${V_VIDOFF}" | 315 echo -e "${V_BOLD_YELLOW}WARNING: $1${V_VIDOFF}" |
311 } | 316 } |
312 | 317 |
313 function error { | 318 function error { |
314 echo -e "${V_BOLD_RED}ERROR : $1${V_VIDOFF}" | 319 echo -e "${V_BOLD_RED}ERROR : $1${V_VIDOFF}" |
315 } | 320 } |
316 | 321 |
317 function die { | 322 function die { |
318 error "$1" | 323 error "$1" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 427 |
423 # Setup var symlink. | 428 # Setup var symlink. |
424 if [ -h "${dev_image_root}/var" ]; then | 429 if [ -h "${dev_image_root}/var" ]; then |
425 sudo unlink "${dev_image_root}/var" | 430 sudo unlink "${dev_image_root}/var" |
426 elif [ -e "${dev_image_root}/var" ]; then | 431 elif [ -e "${dev_image_root}/var" ]; then |
427 die "${dev_image_root}/var should be a symlink if it exists" | 432 die "${dev_image_root}/var should be a symlink if it exists" |
428 fi | 433 fi |
429 | 434 |
430 sudo ln -s "${var_target}" "${dev_image_root}/var" | 435 sudo ln -s "${var_target}" "${dev_image_root}/var" |
431 } | 436 } |
OLD | NEW |