From 157815f305aaf282fbe34137c7609b6574277012 Mon Sep 17 00:00:00 2001 From: Packet Please Date: Tue, 5 Nov 2024 02:02:55 +0100 Subject: [PATCH] build: more robust failure detection - Carry over only the relevant files (images and faillogs) - Delete faillog only if there are actual images for the device --- build/build.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index 8a2f60d..15f9997 100755 --- a/build/build.sh +++ b/build/build.sh @@ -249,13 +249,15 @@ EOF |& tee "bin/targets/$target/faillogs/$p.log" >&2 # if build resulted in image files, we can delete the log - if ls "bin/targets/$target/"*"$p"* >/dev/null; then + cnt="$(find "bin/targets/$target" -name '*.bin' -or -name '*.img' | wc -l)" + if [ "$cnt" -gt 0 ] ; then rm -v "bin/targets/$target/faillogs/$p.log" fi done ) \ |& tee "$destdir/build.log" >&2 -mv "$ibdir/bin/targets/$target"/* "$destdir/" + +find "$ibdir/bin/targets/$target" \( -name '*.bin' -or -name '*.img' -or -name 'faillogs' \) -exec cp -avx '{}' "$destdir/" \; echo "Done."