summaryrefslogtreecommitdiff
path: root/include/tree.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-09-26 00:09:46 +0100
committerLeah Rowe <leah@libreboot.org>2025-09-26 00:09:46 +0100
commite42cb4f4cd513f512397ff7a46b6174b39a9708e (patch)
treeab6ba25c737cfa17ed6bc6eb9e1c4f5419ff892b /include/tree.sh
parentf5060232e16ab1c041f0108a5f65d8f96f79756d (diff)
xbmk: tidy up some if statements
this is an extension of the previous work to unroll most of the condensed code lines. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/tree.sh')
-rw-r--r--include/tree.sh30
1 files changed, 6 insertions, 24 deletions
diff --git a/include/tree.sh b/include/tree.sh
index 51a7f2ff..9e4b13b3 100644
--- a/include/tree.sh
+++ b/include/tree.sh
@@ -63,14 +63,10 @@ trees()
if [ -z "$_f" ]; then
err "missing flag ($flags)" "trees" "$@"
- fi
-
- if [ -z "$project" ]; then
+ elif [ -z "$project" ]; then
fx_ "x_ ./mk $_f" x_ ls -1 config/git
return 1
- fi
-
- if [ ! -f "config/git/$project/pkg.cfg" ]; then
+ elif [ ! -f "config/git/$project/pkg.cfg" ]; then
err "config/git/$project/pkg.cfg missing" "trees" "$@"
fi
@@ -156,7 +152,6 @@ handle_defconfig()
if [ ! -f "CHANGELOG" ]; then
fetch_project "$project"
fi
-
if ! configure_project "$target_dir"; then
return 0
fi
@@ -234,21 +229,18 @@ configure_project()
if [ "$_f" = "-d" ]; then
build_depend="" # dry run
fi
-
if [ "$cmd" = "build_project" ]; then
# single-tree, so it can't be a target pointing
# to a main source tree
break
fi
-
if [ "$do_make" != "n" ]; then
# if we're *downloading* a project, then
# we don't need to to change the target.cfg
break
fi
-
if [ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ]
then
# we have found the main source tree that
@@ -264,7 +256,6 @@ configure_project()
if [ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ]; then
return 1
fi
-
if [ -n "$btype" ] && [ "${mode%config}" != "$mode" ]; then
return 1
fi
@@ -281,10 +272,8 @@ configure_project()
if [ ! -f "CHANGELOG" ]; then
delete_old_project_files
fi
-
if [ "$do_make" = "n" ]; then
- if [ ! -f "CHANGELOG" ]
- then
+ if [ ! -f "CHANGELOG" ]; then
fetch_${cmd#build_}
fi
@@ -308,11 +297,9 @@ build_dependencies()
$dry err "$project/$tree: !bd '$bd'" \
"build_dependencies" "$@"
fi
-
if [ "${bd##*/}" = "$bd" ]; then
bd_tree=""
fi
-
if [ -n "$bd_project" ]; then
$dry x_ ./mk -b $bd_project $bd_tree; :
fi
@@ -591,18 +578,13 @@ check_autoconf()
(
x_ cd "$1"
- if [ -f "bootstrap" ]
- then
+ if [ -f "bootstrap" ]; then
x_ ./bootstrap $bootstrapargs
fi
-
- if [ -f "autogen.sh" ]
- then
+ if [ -f "autogen.sh" ]; then
x_ ./autogen.sh $autogenargs
fi
-
- if [ -f "configure" ]
- then
+ if [ -f "configure" ]; then
x_ ./configure $autoconfargs; :
fi