From 0b1baf60552fe688bee6e304b3de893870fd467b Mon Sep 17 00:00:00 2001 From: David James Date: Thu, 15 Mar 2012 09:26:23 -0700 Subject: [PATCH] Use common.sh from the source directory. Update setup_board and build_packages to use common.sh from source directory, so that changes in common.sh show up immediately. BUG=chromium-os:27364 TEST=Run each script, testing that changes to common.sh are picked up. Change-Id: I6847bbf8c486d14c58dfcbb9361cd606c11c817b Reviewed-on: https://gerrit.chromium.org/gerrit/18245 Reviewed-by: David James Tested-by: David James Commit-Ready: David James --- build_packages | 20 +------------------- setup_board | 20 +------------------- update_chroot | 5 +---- 3 files changed, 3 insertions(+), 42 deletions(-) diff --git a/build_packages b/build_packages index e4fb387690..a8dd6ced6d 100755 --- a/build_packages +++ b/build_packages @@ -9,25 +9,7 @@ # binary packages as a side-effect. The output packages will be picked up # by the build_image script to put together a bootable Chrome OS image. -# Load common CrOS utilities. Inside the chroot this file is installed in -# /usr/lib/crosutils. Outside the chroot we find it relative to the script's -# location. -find_common_sh() { - local common_paths=(/usr/lib/crosutils $(dirname "$0")) - local path - - SCRIPT_ROOT= - for path in "${common_paths[@]}"; do - local common="${path}/common.sh" - if ([ -r "${common}" ] && . "${common}" && [ -d "${SCRIPTS_DIR}" ]); then - SCRIPT_ROOT=${path} - break - fi - done -} - -find_common_sh -. "${SCRIPT_ROOT}/common.sh" || ! echo "Unable to load common.sh" || exit 1 +. "$(dirname "$0")/common.sh" || exit 1 # Script must run inside the chroot restart_in_chroot_if_needed "$@" diff --git a/setup_board b/setup_board index 6949a01aa0..b69b0dfd5e 100755 --- a/setup_board +++ b/setup_board @@ -6,25 +6,7 @@ # This script sets up a the sysroot for a particular target board. -# Load common CrOS utilities. Inside the chroot this file is installed in -# /usr/lib/crosutils. Outside the chroot we find it relative to the script's -# location. -find_common_sh() { - local common_paths=(/usr/lib/crosutils $(dirname "$0")) - local path - - SCRIPT_ROOT= - for path in "${common_paths[@]}"; do - local common="${path}/common.sh" - if ([ -r "${common}" ] && . "${common}" && [ -d "${SCRIPTS_DIR}" ]); then - SCRIPT_ROOT=${path} - break - fi - done -} - -find_common_sh -. "${SCRIPT_ROOT}/common.sh" || ! echo "Unable to load common.sh" || exit 1 +. "$(dirname "$0")/common.sh" || exit 1 . "${SRC_ROOT}/platform/dev/toolchain_utils.sh" # Script must run inside the chroot diff --git a/update_chroot b/update_chroot index b0825391b3..bfc241c5a6 100755 --- a/update_chroot +++ b/update_chroot @@ -6,10 +6,7 @@ # Performs an update of the chroot. -# Load common CrOS utilities. Inside the chroot this file is installed in -# /usr/lib/crosutils. Outside the chroot we find it relative to the script's -# location. -. "$(dirname $0)/common.sh" || { echo "Unable to load common.sh"; exit 1; } +. "$(dirname "$0")/common.sh" || exit 1 # Script must run inside the chroot assert_inside_chroot "$@"