| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 return $do_shift | 376 return $do_shift |
| 377 } | 377 } |
| 378 | 378 |
| 379 V_RED="\e[31m" | 379 V_RED="\e[31m" |
| 380 V_YELLOW="\e[33m" | 380 V_YELLOW="\e[33m" |
| 381 V_BOLD_GREEN="\e[1;32m" | 381 V_BOLD_GREEN="\e[1;32m" |
| 382 V_BOLD_RED="\e[1;31m" | 382 V_BOLD_RED="\e[1;31m" |
| 383 V_BOLD_YELLOW="\e[1;33m" | 383 V_BOLD_YELLOW="\e[1;33m" |
| 384 | 384 |
| 385 function info { | 385 function info { |
| 386 echo -e >&2 "${V_BOLD_GREEN}INFO : $1${V_VIDOFF}" | 386 echo -e >&2 "${V_BOLD_GREEN}INFO ${CROS_LOG_PREFIX:-""}: $1${V_VIDOFF}" |
| 387 } | 387 } |
| 388 | 388 |
| 389 function warn { | 389 function warn { |
| 390 echo -e >&2 "${V_BOLD_YELLOW}WARNING: $1${V_VIDOFF}" | 390 echo -e >&2 "${V_BOLD_YELLOW}WARNING ${CROS_LOG_PREFIX:-""}: $1${V_VIDOFF}" |
| 391 } | 391 } |
| 392 | 392 |
| 393 function error { | 393 function error { |
| 394 echo -e >&2 "${V_BOLD_RED}ERROR : $1${V_VIDOFF}" | 394 echo -e >&2 "${V_BOLD_RED}ERROR ${CROS_LOG_PREFIX:-""}: $1${V_VIDOFF}" |
| 395 } | 395 } |
| 396 | 396 |
| 397 function die { | 397 function die { |
| 398 error "$1" | 398 error "$1" |
| 399 exit 1 | 399 exit 1 |
| 400 } | 400 } |
| 401 | 401 |
| 402 # Retry an emerge command according to $FLAGS_retries | 402 # Retry an emerge command according to $FLAGS_retries |
| 403 # The $EMERGE_JOBS flags will only be added the first time the command is run | 403 # The $EMERGE_JOBS flags will only be added the first time the command is run |
| 404 function eretry () { | 404 function eretry () { |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 args="${args} --force_copy" | 640 args="${args} --force_copy" |
| 641 fi | 641 fi |
| 642 | 642 |
| 643 # Modify the image for test, creating a new test image | 643 # Modify the image for test, creating a new test image |
| 644 "${SCRIPTS_DIR}/mod_image_for_test.sh" --board=${FLAGS_board} \ | 644 "${SCRIPTS_DIR}/mod_image_for_test.sh" --board=${FLAGS_board} \ |
| 645 --image="$1/$2" --noinplace ${args} | 645 --image="$1/$2" --noinplace ${args} |
| 646 | 646 |
| 647 # From now on we use the just-created test image | 647 # From now on we use the just-created test image |
| 648 CHROMEOS_RETURN_VAL="$1/${CHROMEOS_TEST_IMAGE_NAME}" | 648 CHROMEOS_RETURN_VAL="$1/${CHROMEOS_TEST_IMAGE_NAME}" |
| 649 } | 649 } |
| OLD | NEW |