summaryrefslogtreecommitdiff
path: root/script/update
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-12-22 13:05:32 +0000
committerLeah Rowe <leah@libreboot.org>2023-12-23 02:52:30 +0000
commitb0e5fc9d9c8f648b2b98c48d126cf8e6e828ddd4 (patch)
tree4b9de2046d8923e7e38754276bf3911741d9a54b /script/update
parentb111f4840a043a7337937c001e1f82b7af3302f2 (diff)
lbmk scripts: general code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/update')
-rwxr-xr-xscript/update/trees21
1 files changed, 8 insertions, 13 deletions
diff --git a/script/update/trees b/script/update/trees
index 6e98b370..832f27c5 100755
--- a/script/update/trees
+++ b/script/update/trees
@@ -36,11 +36,9 @@ main()
[ -z "${_f}" ] && err "missing flag (-m/-u/-b/-c/-x/-f/-s/-l/-n)"
[ -z "${project}" ] && err "project name not specified"
- if [ -f "config/${project}/build.list" ]; then
- build_targets $@
- else
- build_projects $@
- fi
+ _cmd="build_projects"
+ [ -f "config/${project}/build.list" ] && _cmd="build_targets"
+ $_cmd $@
}
build_projects()
@@ -103,7 +101,7 @@ handle_targets()
x_ handle_defconfig
done
- [ "${target1}" = "utils" ] && [ "${project}" = "coreboot" ] && return 0
+ [ "$target1" = "utils" ] && [ "$project" = "coreboot" ] && return 0
[ -z "${mode}" ] || return 0
printf "Done! The files are stored under %s/\n\n" "${elfdir}"
}
@@ -161,10 +159,7 @@ handle_src_tree()
x_ ./update trees -f "${project}" "${target}"
fi
- [ "${target1}" = "utils" ] && [ "${project}" = "coreboot" ] && return 0
- [ "$project" != "coreboot" ] && [ "$project" != "u-boot" ] && return 0
-
- # u-boot and coreboot are both compiled with coreboot's crossgcc
+ [ "$target1" = "utils" ] && [ "$project" = "coreboot" ] && return 0
[ -z "${mode}" ] || return 0
check_cross_compiler
}
@@ -199,7 +194,7 @@ check_cross_compiler()
check_config()
{
- [ ! -f "${config}" ] && \
+ [ -f "${config}" ] || \
err "check_config: ${project}/${target}: configs missing"
dest_dir="${elfdir}/${target}/${config_name}"
@@ -224,8 +219,8 @@ handle_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
+ elif [ "$mode" = "oldconfig" ] || [ "$mode" = "olddefconfig" ] || \
+ [ "$mode" = "menuconfig" ] || [ "$mode" = "nconfig" ]; then
x_ cp "${codedir}/.config" "${config}"
elif [ "${mode}" = "savedefconfig" ]; then
x_ cp "${codedir}/defconfig" "${config}"