From ffcb29b5de9400c8e9785287630b139fdc76080f Mon Sep 17 00:00:00 2001 From: Blagovest Kolenichev Date: Mon, 30 May 2022 15:34:25 -0700 Subject: [PATCH] build.config.msm.common: Fix corner case in copy_dist_bins() Fix below errors: ls: build/android/merge_dtbs.py: No such file or directory ls: build/build-tools/path/linux-x86/ufdt_apply_overlay: No such file or directory They are printed by command [1] and in this case it will produce empty files list. This happens if current working directory is NOT the assumed, hence even ${ROOT_DIR}/${FILE} to exists, it will not be able to reach to that point since the "for" cycle will be not executed at all. Files are checked for existence, hence no need to be checked redundantly with `ls' command too. [1] ls -1 ${DIST_BINS} Change-Id: I1baf60e91ce63fb9e4190881298d6ffe6e9ac9ab Signed-off-by: Blagovest Kolenichev Signed-off-by: John Moon --- build.config.msm.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.config.msm.common b/build.config.msm.common index 4c58c8b02bc0..db536fe78af1 100644 --- a/build.config.msm.common +++ b/build.config.msm.common @@ -239,7 +239,7 @@ function copy_dist_bins() ( set -e mkdir -p ${COMMON_OUT_DIR}/host/bin echo "Copying binaries to host/bin" - for FILE in $(ls -1 ${DIST_BINS}); do + for FILE in ${DIST_BINS}; do if [ -f ${ROOT_DIR}/${FILE} ]; then echo " $FILE" cp -p ${ROOT_DIR}/${FILE} ${COMMON_OUT_DIR}/host/bin/