summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-07 15:02:32 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-07 15:04:24 +0100
commit668bcbf69cbc250a49134056c1bf870af62e36e1 (patch)
tree1fd2f35236d8097d1c265dcdde76bb65f9efc26b /script
parent3eef7f37f293e804560e1a7f3a76a46e707f4775 (diff)
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 <leah@libreboot.org>
Diffstat (limited to 'script')
-rwxr-xr-xscript/trees5
1 files changed, 2 insertions, 3 deletions
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"