summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-04-26 22:02:26 +0100
committerLeah Rowe <leah@libreboot.org>2025-04-26 22:02:26 +0100
commit18ad654a1f71dd8734bf45d6c9f7062b80bdd144 (patch)
treec49501e37e98fe8078f1a464d96e0bdb03f60bc9 /include
parent15268202478290b645e5d7c824a0c6f63e06373f (diff)
init.sh: merge xbmk_child_init with xbmk_init
the for loop at the end of xbmk_init does essentially the same thing. adapt accordingly, and merge. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
-rw-r--r--include/init.sh20
1 files changed, 7 insertions, 13 deletions
diff --git a/include/init.sh b/include/init.sh
index 1518f358..1a383bd7 100644
--- a/include/init.sh
+++ b/include/init.sh
@@ -51,8 +51,9 @@ xbmk_init()
eval "[ ! -f \".$fv\" ] || read -r $fv < \".$fv\" || :"
done
- for xbmk_cmd in setpyver init_vars init_ver xbmk_child_init; do
- $xbmk_cmd "$@"
+ for init_cmd in set_pyver init_vars init_ver create_tmpdir lock \
+ create_pathdirs child_exec; do
+ xbmk_$init_cmd "$@" || break
done
}
@@ -86,7 +87,7 @@ chkvars()
done; :
}
-setpyver()
+xbmk_set_pyver()
{
pyv="import sys; print(sys.version_info[:])"
python="python3"
@@ -136,7 +137,7 @@ pybin()
command -v "$1" 2>/dev/null || return 1
}
-init_vars()
+xbmk_init_vars()
{
# XBMK_CACHE is a directory, for caching downloads and git repon
[ -z "${XBMK_CACHE+x}" ] && export XBMK_CACHE="$xbmkpwd/cache"
@@ -158,10 +159,10 @@ init_vars()
[ -e ".git" ] || [ -f ".version" ] || printf "unknown\n" > .version \
|| $err "Cannot generate unknown .version file"
[ -e ".git" ] || [ -f ".versiondate" ] || printf "1716415872\n" > \
- .versiondate || $err "Cannot generate unknown .versiondate file"
+ .versiondate || $err "Cannot generate unknown .versiondate file"; :
}
-init_ver()
+xbmk_init_ver()
{
version_="$version"
[ ! -e ".git" ] || version="$(git describe --tags HEAD 2>&1)" || \
@@ -178,13 +179,6 @@ init_ver()
export LOCALVERSION="-$projectname-${version%%-*}"
}
-xbmk_child_init()
-{
- for init_cmd in create_tmpdir lock create_pathdirs child_exec; do
- xbmk_$init_cmd "$@" || return 0; :
- done
-}
-
xbmk_create_tmpdir()
{
# unify all temporary files/directories in a single TMPDIR