From 69f3cbe0a21dea9310bc2122ea9fb3167b04c2de Mon Sep 17 00:00:00 2001 From: robotboy Date: Tue, 23 Mar 2010 14:01:41 -0700 Subject: [PATCH] Fix board lookup code to work from any directory. Review URL: http://codereview.chromium.org/1203001 --- autotest_lib.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autotest_lib.sh b/autotest_lib.sh index f60382c5c8..c4ad9d6795 100644 --- a/autotest_lib.sh +++ b/autotest_lib.sh @@ -15,11 +15,13 @@ function check_board() { local board_names="" local index=1 local found=0 - for board in ../overlays/overlay-* + for overlay_path in "${SRC_ROOT}"/overlays/overlay-* do - board_names[index]=${board:20} + local overlay="$(basename \"${overlay_path}\")" + local board="${overlay#overlay-}" + board_names[index]="${board}" index+=1 - if [ "${FLAGS_board}" == "${board:20}" ] + if [ "${FLAGS_board}" == "${board}" ] then found=1 fi