From a88a8281df1d3688bb772578a3dd7d7cc1af1091 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 28 Apr 2024 19:28:02 +0100 Subject: [PATCH] update/trees: simplified defconfig copying Signed-off-by: Leah Rowe --- script/update/trees | 16 +++++++--------- 1 file 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()