From 13ad0bcde55d095fd0611881841627a55c3211a3 Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Wed, 19 Jul 2017 00:20:07 +0000 Subject: jjb/common: run-test-rsync: fix empty variables Some variables are allowed to exist, but be empty (e.g. $DEVICE_DTB for QEMU builds.) If the variable is empty, do not attempt to copy. Change-Id: I89850402a225766496e5c2b5b9a45ffa6ec11815 Signed-off-by: Kevin Hilman --- jjb/common/include-agl-run-test-rsync-changeid.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'jjb/common') diff --git a/jjb/common/include-agl-run-test-rsync-changeid.sh b/jjb/common/include-agl-run-test-rsync-changeid.sh index 64165553..be3f68bb 100644 --- a/jjb/common/include-agl-run-test-rsync-changeid.sh +++ b/jjb/common/include-agl-run-test-rsync-changeid.sh @@ -25,9 +25,12 @@ cd output pwd ls -alhR tmp/deploy/images -# copy files to $DEST +# copy files to $DEST (only if variable is non-empty) for i in DEVICE_DTB DEVICE_KERNEL DEVICE_INITRAMFS DEVICE_NBDROOT; do - eval cp -avL tmp/deploy/images/${TARGETMACHINE}/$(echo "$"${i}) ${DEST}/ + FILE=$(eval echo \$${i}) + if [ -n "$FILE" ]; then + cp -avL tmp/deploy/images/${TARGETMACHINE}/${FILE} ${DEST}/ + fi done tree $DEST -- cgit 1.2.3-korg