From 668bcbf69cbc250a49134056c1bf870af62e36e1 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 7 Jun 2024 15:02:32 +0100 Subject: trees: simplified copy_elf() handling don't create elfdir, create dest_dir, which is elfdir plus the location within it only create dest_dir within copy_elf, which is only called if actually compiling the code this avoids creating empty elf directories, and it generally cleans up all handling, unifying the handling of directories into a single function, namely copy_elf() which already exists Signed-off-by: Leah Rowe --- script/trees | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'script/trees') diff --git a/script/trees b/script/trees index faaddc5f..e413f610 100755 --- a/script/trees +++ b/script/trees @@ -68,8 +68,6 @@ build_projects() [ "$mode" = "distclean" ] && mode="clean" run_make_command || return 0 - [ -f "$listfile" ] || return 0 - [ -n "$mode" ] || x_ mkdir -p "$elfdir" [ -n "$mode" ] || copy_elf; return 0 } @@ -87,7 +85,6 @@ build_targets() targets="$(items "$cfgsdir")" || $err "Can't get options for $cfgsdir" [ $# -gt 0 ] && targets=$@ - [ -z "$mode" ] && x_ mkdir -p "$elfdir" handle_targets } @@ -292,6 +289,8 @@ copy_elf() [ -n "$listfile" ] || return 0 [ -f "$listfile" ] || return 0 + x_ mkdir -p "$dest_dir" + while read -r f; do [ -f "$cdir/$f" ] && x_ cp "$cdir/$f" "$dest_dir" done < "$listfile" -- cgit v1.2.1