summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-07 19:03:51 +0100
committerLeah Rowe <leah@libreboot.org>2025-05-07 19:03:51 +0100
commit40a944118f2af08ab37719c07cf7e826267a0eef (patch)
tree5742760c3041314fee7c3b074a8744cf23de9fe5
parentcba04aa74b816cbd5f1266a73962f6dd48ee2892 (diff)
init.sh: run set_version before set_env
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/init.sh42
1 files changed, 21 insertions, 21 deletions
diff --git a/include/init.sh b/include/init.sh
index 5032d734..6ccdf13f 100644
--- a/include/init.sh
+++ b/include/init.sh
@@ -31,7 +31,7 @@ xbmk_init()
id -u 1>/dev/null 2>/dev/null || err "suid check failed (id -u)"
[ "$(id -u)" != "0" ] || err "this command as root is not permitted"
- for init_cmd in set_pyver set_env set_version git_init create_tmpdir \
+ for init_cmd in set_pyver set_version set_env git_init create_tmpdir \
lock create_pathdirs child_exec; do
xbmk_$init_cmd "$@" || break
done
@@ -97,26 +97,6 @@ pybin()
command -v "$1" 2>/dev/null || return 1
}
-xbmk_set_env()
-{
- # XBMK_CACHE is a directory, for caching downloads and git repon
- [ -z "${XBMK_CACHE+x}" ] && export XBMK_CACHE="$xbmkpwd/cache"
- [ -z "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache"
- [ -L "$XBMK_CACHE" ] && [ "$XBMK_CACHE" = "$xbmkpwd/cache" ] && \
- err "cachedir '$xbmkpwd/cache' is a symlink"
- [ -L "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache"
- [ -f "$XBMK_CACHE" ] && err "cachedir '$XBMK_CACHE' is a file"; :
-
- # if "y": a coreboot target won't be built if target.cfg says release="n"
- # (this is used to exclude certain build targets from releases)
- [ -z "${XBMK_RELEASE+x}" ] && export XBMK_RELEASE="n"
- [ "$XBMK_RELEASE" = "y" ] || export XBMK_RELEASE="n"
-
- [ -z "${XBMK_THREADS+x}" ] && export XBMK_THREADS=1
- expr "X$XBMK_THREADS" : "X-\{0,1\}[0123456789][0123456789]*$" \
- 1>/dev/null 2>/dev/null || export XBMK_THREADS=1; :
-}
-
xbmk_set_version()
{
[ ! -f ".version" ] || read -r version < ".version" || :; :
@@ -142,6 +122,26 @@ xbmk_set_version()
export LOCALVERSION="-$projectname-${version%%-*}"
}
+xbmk_set_env()
+{
+ # XBMK_CACHE is a directory, for caching downloads and git repon
+ [ -z "${XBMK_CACHE+x}" ] && export XBMK_CACHE="$xbmkpwd/cache"
+ [ -z "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache"
+ [ -L "$XBMK_CACHE" ] && [ "$XBMK_CACHE" = "$xbmkpwd/cache" ] && \
+ err "cachedir '$xbmkpwd/cache' is a symlink"
+ [ -L "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache"
+ [ -f "$XBMK_CACHE" ] && err "cachedir '$XBMK_CACHE' is a file"; :
+
+ # if "y": a coreboot target won't be built if target.cfg says release="n"
+ # (this is used to exclude certain build targets from releases)
+ [ -z "${XBMK_RELEASE+x}" ] && export XBMK_RELEASE="n"
+ [ "$XBMK_RELEASE" = "y" ] || export XBMK_RELEASE="n"
+
+ [ -z "${XBMK_THREADS+x}" ] && export XBMK_THREADS=1
+ expr "X$XBMK_THREADS" : "X-\{0,1\}[0123456789][0123456789]*$" \
+ 1>/dev/null 2>/dev/null || export XBMK_THREADS=1; :
+}
+
xbmk_git_init()
{
for gitarg in "--global user.name" "--global user.email"; do