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 <quic_c_bkolen@quicinc.com>
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
This commit is contained in:
Blagovest Kolenichev 2022-05-30 15:34:25 -07:00 committed by John Moon
parent 6e308e1672
commit ffcb29b5de

View File

@ -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/