summaryrefslogtreecommitdiff
path: root/script/trees
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-04-11 04:44:24 +0100
committerLeah Rowe <leah@libreboot.org>2025-04-11 04:47:04 +0100
commitd0bd12631a6bb4d3035fa85e4446d128de803b0f (patch)
tree3262fbc2a150b8c6305a5f85130b502efc34c1d4 /script/trees
parentc4cd876c609631fa88066cc30f31b62d7c138635 (diff)
trees: don't abuse the mode variable on -f
The "mode" variable is used as a suffix for make commands, for example ./mk -m sets mode to "menuconfig", which means you want to run "make menuconfig". When fetching sources (./mk -f), I was setting mode to "fetch", and putting checks in code to avoid use of make when mode was set to "fetch". The behaviour now is identical, except that a new variable called "do_make" is set to "n" when doing ./mk -f, otherwise set to "y", and this is checked instead. This should make the meaning of the code somewhat clearer. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/trees')
-rwxr-xr-xscript/trees10
1 files changed, 7 insertions, 3 deletions
diff --git a/script/trees b/script/trees
index 3b4cce15..1907dea9 100755
--- a/script/trees
+++ b/script/trees
@@ -17,6 +17,10 @@ eval "`setvars "" xarch srcdir premake gnatdir xlang mode makeargs elfdir cmd \
defconfig postmake mkhelpercfg dry dest_dir mdir cleanargs gccver gccfull \
gnatver gnatfull gccdir cmakedir`"; badhash="n"
+# ./mk -f will set this to "n", thus
+# disabling the use of make commands
+do_make="y"
+
main()
{
while getopts f:b:m:u:c:x:s:l:n:d: option; do
@@ -30,7 +34,7 @@ main()
-m) mode="menuconfig" ;;
-c) mode="distclean" ;;
-x) mode="crossgcc-clean" ;;
- -f) mode="fetch" ;;
+ -f) do_make="n" ;;
-s) mode="savedefconfig" ;;
-l) mode="olddefconfig" ;;
-n) mode="nconfig" ;;
@@ -145,7 +149,7 @@ configure_project()
[ "$_f" = "-d" ] && build_depend="" # dry run
[ "$cmd" = "build_project" ] && break
- [ "$mode" = "fetch" ] || break
+ [ "$do_make" = "y" ] && break
[ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ] \
&& break
@@ -159,7 +163,7 @@ configure_project()
[ -n "$tree" ] && mdir="$mdir/$tree"
[ -f "CHANGELOG" ] || check_project_hashes
- if [ "$mode" != "fetch" ]; then
+ if [ "$do_make" = "y" ]; then
x_ ./mk -f "$project" "$target"
return 0
fi