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

Side by Side Diff: common.sh

Issue 6609016: Select factory image when --factory is given (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | mod_image_for_test.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 # Check for forcing copy of image 638 # Check for forcing copy of image
639 if [ ${FLAGS_force_copy} -eq ${FLAGS_TRUE} ]; then 639 if [ ${FLAGS_force_copy} -eq ${FLAGS_TRUE} ]; then
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 if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ]; then
649 CHROMEOS_RETURN_VAL="$1/${CHROMEOS_FACTORY_TEST_IMAGE_NAME}"
650 else
651 CHROMEOS_RETURN_VAL="$1/${CHROMEOS_TEST_IMAGE_NAME}"
652 fi
649 } 653 }
650 654
651 # Check that the specified file exists. If the file path is empty or the file 655 # Check that the specified file exists. If the file path is empty or the file
652 # doesn't exist on the filesystem generate useful error messages. Otherwise 656 # doesn't exist on the filesystem generate useful error messages. Otherwise
653 # show the user the name and path of the file that will be used. The padding 657 # show the user the name and path of the file that will be used. The padding
654 # parameter can be used to tabulate multiple name:path pairs. For example: 658 # parameter can be used to tabulate multiple name:path pairs. For example:
655 # 659 #
656 # check_for_file "really long name" "...:" "file.foo" 660 # check_for_file "really long name" "...:" "file.foo"
657 # check_for_file "short name" ".........:" "another.bar" 661 # check_for_file "short name" ".........:" "another.bar"
658 # 662 #
(...skipping 26 matching lines...) Expand all
685 check_for_tool() { 689 check_for_tool() {
686 local tool=$1 690 local tool=$1
687 local ebuild=$2 691 local ebuild=$2
688 692
689 if ! which "${tool}" >/dev/null ; then 693 if ! which "${tool}" >/dev/null ; then
690 error "The ${tool} utility was not found in your path. Run the following" 694 error "The ${tool} utility was not found in your path. Run the following"
691 error "command in your chroot to install it: sudo -E emerge ${ebuild}" 695 error "command in your chroot to install it: sudo -E emerge ${ebuild}"
692 exit 1 696 exit 1
693 fi 697 fi
694 } 698 }
OLDNEW
« no previous file with comments | « no previous file | mod_image_for_test.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698