mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-14 15:29:35 +02:00
tree.sh: rename _f to flag, for code clarity
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+11
-9
@@ -4,6 +4,9 @@
|
|||||||
# Copyright (c) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
|
# Copyright (c) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
|
||||||
# Copyright (c) 2023-2025 Leah Rowe <leah@libreboot.org>
|
# Copyright (c) 2023-2025 Leah Rowe <leah@libreboot.org>
|
||||||
|
|
||||||
|
# flag e.g. ./mk -b <-- mkflag would be "b"
|
||||||
|
flag=""
|
||||||
|
|
||||||
xarch=""
|
xarch=""
|
||||||
srcdir=""
|
srcdir=""
|
||||||
premake=""
|
premake=""
|
||||||
@@ -18,7 +21,6 @@ target=""
|
|||||||
target_dir=""
|
target_dir=""
|
||||||
targets=""
|
targets=""
|
||||||
xtree=""
|
xtree=""
|
||||||
_f=""
|
|
||||||
release=""
|
release=""
|
||||||
bootstrapargs=""
|
bootstrapargs=""
|
||||||
mkhelper=""
|
mkhelper=""
|
||||||
@@ -53,16 +55,16 @@ trees()
|
|||||||
|
|
||||||
while getopts $flags option
|
while getopts $flags option
|
||||||
do
|
do
|
||||||
if [ -n "$_f" ]; then
|
if [ -n "$flag" ]; then
|
||||||
err "only one flag is permitted" "trees" "$@"
|
err "only one flag is permitted" "trees" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_f="$1"
|
flag="$1"
|
||||||
|
|
||||||
# the "mode" variable is affixed to a make command, example:
|
# the "mode" variable is affixed to a make command, example:
|
||||||
# ./mk -m coreboot does: make menuconfig -C src/coreboot/tree
|
# ./mk -m coreboot does: make menuconfig -C src/coreboot/tree
|
||||||
|
|
||||||
case "$_f" in
|
case "$flag" in
|
||||||
-d)
|
-d)
|
||||||
# -d is similar to -b, except that
|
# -d is similar to -b, except that
|
||||||
# a large number of operations will be
|
# a large number of operations will be
|
||||||
@@ -104,10 +106,10 @@ trees()
|
|||||||
shift 2
|
shift 2
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -z "$_f" ]; then
|
if [ -z "$flag" ]; then
|
||||||
err "missing flag ($flags)" "trees" "$@"
|
err "missing flag ($flags)" "trees" "$@"
|
||||||
elif [ -z "$project" ]; then
|
elif [ -z "$project" ]; then
|
||||||
fx_ "x_ ./mk $_f" x_ ls -1 config/git
|
fx_ "x_ ./mk $flag" x_ ls -1 config/git
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
@@ -222,9 +224,9 @@ handle_defconfig()
|
|||||||
|
|
||||||
for y in "$target_dir/config"/*
|
for y in "$target_dir/config"/*
|
||||||
do
|
do
|
||||||
if [ "$_f" != "-d" ] && [ ! -f "$y" ]; then
|
if [ "$flag" != "-d" ] && [ ! -f "$y" ]; then
|
||||||
continue
|
continue
|
||||||
elif [ "$_f" != "-d" ]; then
|
elif [ "$flag" != "-d" ]; then
|
||||||
defconfig="$y"
|
defconfig="$y"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -301,7 +303,7 @@ configure_project()
|
|||||||
. "$_tcfg" || \
|
. "$_tcfg" || \
|
||||||
err "Can't read '$_tcfg'" "configure_project" "$@"
|
err "Can't read '$_tcfg'" "configure_project" "$@"
|
||||||
|
|
||||||
if [ "$_f" = "-d" ]; then
|
if [ "$flag" = "-d" ]; then
|
||||||
build_depend="" # dry run
|
build_depend="" # dry run
|
||||||
fi
|
fi
|
||||||
if [ "$cmd" = "build_project" ]; then
|
if [ "$cmd" = "build_project" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user