summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-04-28 19:28:02 +0100
committerLeah Rowe <leah@libreboot.org>2024-04-28 19:28:02 +0100
commita88a8281df1d3688bb772578a3dd7d7cc1af1091 (patch)
tree34707a09c6c889c88aa1801f707b67074e493024 /script
parent55204dc4449456c6a11ed19f530b7673143450a5 (diff)
update/trees: simplified defconfig copying
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script')
-rwxr-xr-xscript/update/trees16
1 files changed, 7 insertions, 9 deletions
diff --git a/script/update/trees b/script/update/trees
index ac5743be..af80d99a 100755
--- a/script/update/trees
+++ b/script/update/trees
@@ -199,15 +199,13 @@ handle_makefile()
run_make_command || $err "handle_makefile $codedir: no makefile!"
- if [ -e "${codedir}/.git" ] && [ "$project" = "u-boot" ] && \
- [ "$mode" = "distclean" ]; then
- x_ git -C "$codedir" clean -fdx
- elif [ "$mode" = "oldconfig" ] || [ "$mode" = "olddefconfig" ] || \
- [ "$mode" = "menuconfig" ] || [ "$mode" = "nconfig" ]; then
- x_ cp "${codedir}/.config" "$config"
- elif [ "$mode" = "savedefconfig" ]; then
- x_ cp "${codedir}/defconfig" "$config"
- fi
+ _copy=".config"
+ [ "$mode" = "savedefconfig" ] && _copy="defconfig"
+ [ "${mode%config}" = "$mode" ] || x_ cp "$codedir/$_copy" "$config"
+
+ [ -e "${codedir}/.git" ] && [ "$project" = "u-boot" ] && \
+ [ "$mode" = "distclean" ] && \
+ x_ git -C "$codedir" clean -fdx; return 0
}
run_make_command()