From d9c64b267540a7c0a62f219c1c27c790234fd11c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 19:24:43 +0100 Subject: xbmk: stricter handling of files on while loops i overlooked these! Signed-off-by: Leah Rowe --- include/tree.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/tree.sh') diff --git a/include/tree.sh b/include/tree.sh index 25d4732c..9dccf857 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -332,8 +332,9 @@ check_makefile() copy_elf() { - [ -f "$listfile" ] && x_ mkdir -p "$dest_dir" && while read -r f; do + [ -f "$listfile" ] && x_ mkdir -p "$dest_dir" + [ ! -f "$listfile" ] || while read -r f; do [ -f "$srcdir/$f" ] && x_ cp "$srcdir/$f" "$dest_dir" - done < "$listfile" + done < "$listfile" || err "copy_elf $*: cannot read '$listfile'" x_ make clean -C "$srcdir" $cleanargs } -- cgit v1.2.1 From 900da04efa929a9373d5a6f3f56f8b8ac8f193df Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 19:57:06 +0100 Subject: tree.sh: fix up copy_elf(), bad for loop Because of how sh works, having just the [] line causes sh to exit, annoyingly without an error message, but it does cause a non-zero exit. This bug will have already been triggering, before I added the recent error handling on files for this for loop. also do it to the other loop in lib.sh Signed-off-by: Leah Rowe --- include/tree.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/tree.sh') diff --git a/include/tree.sh b/include/tree.sh index 9dccf857..8d787d4c 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -334,7 +334,7 @@ copy_elf() { [ -f "$listfile" ] && x_ mkdir -p "$dest_dir" [ ! -f "$listfile" ] || while read -r f; do - [ -f "$srcdir/$f" ] && x_ cp "$srcdir/$f" "$dest_dir" - done < "$listfile" || err "copy_elf $*: cannot read '$listfile'" + [ -f "$srcdir/$f" ] && x_ cp "$srcdir/$f" "$dest_dir"; : + done < "$listfile" || err "copy_elf $*: cannot read '$listfile'"; : x_ make clean -C "$srcdir" $cleanargs } -- cgit v1.2.1 From a3250d144744e77b6a0d0f7cf011ecc6800edaaf Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 01:17:27 +0100 Subject: tree.sh: Don't run make-clean on dry runs Otherwise, ./mk -d (without arguments) fails for GRUB, which first requires running autoconf to get a Makefile. Signed-off-by: Leah Rowe --- include/tree.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/tree.sh') diff --git a/include/tree.sh b/include/tree.sh index 8d787d4c..83887864 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -275,7 +275,8 @@ elfcheck() handle_makefile() { - $dry check_makefile "$srcdir" && x_ make -C "$srcdir" $cleanargs clean + $dry check_makefile "$srcdir" && \ + $dry x_ make -C "$srcdir" $cleanargs clean [ -f "$defconfig" ] && x_ cp "$defconfig" "$srcdir/.config" [ -n "$mode" ] || [ -n "$btype" ] || $dry make -C \ -- cgit v1.2.1