summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild16
-rwxr-xr-xinclude/err.sh16
2 files changed, 16 insertions, 16 deletions
diff --git a/build b/build
index 14353245..dbcd6939 100755
--- a/build
+++ b/build
@@ -15,23 +15,9 @@ export LC_ALL=C
export LBMK_RELEASE="$lbmk_release"
-eval "$(setvars "" option aur_notice tmpdir)"
+eval "$(setvars "" option aur_notice)"
err="fail"
-tmpdir_was_set="y"
-set | grep TMPDIR 1>/dev/null 2>/dev/null || tmpdir_was_set="n"
-if [ "${tmpdir_was_set}" = "y" ]; then
- [ "${TMPDIR%_*}" = "/tmp/lbmk" ] || tmpdir_was_set="n"
-fi
-if [ "${tmpdir_was_set}" = "n" ]; then
- export TMPDIR="/tmp"
- tmpdir="$(mktemp -d -t lbmk_XXXXXXXX)"
- export TMPDIR="${tmpdir}"
-else
- export TMPDIR="${TMPDIR}"
- tmpdir="${TMPDIR}"
-fi
-
linkpath="${0}"
linkname="${linkpath##*/}"
buildpath="./script/${linkname}"
diff --git a/include/err.sh b/include/err.sh
index 3cadf042..7a6d3fe5 100755
--- a/include/err.sh
+++ b/include/err.sh
@@ -2,7 +2,7 @@
# SPDX-FileCopyrightText: 2022, 2023 Leah Rowe <leah@libreboot.org>
version=""; versiondate=""; projectname=""; _nogit=""
-err="err_"
+err="err_"; tmpdir=""
# 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)
@@ -11,6 +11,20 @@ set | grep LBMK_RELEASE 1>/dev/null 2>/dev/null || lbmk_release="n" || :
[ -z "$lbmk_release" ] && lbmk_release="$LBMK_RELEASE"
[ "$lbmk_release" = "n" ] || [ "$lbmk_release" = "y" ] || lbmk_release="n"
+tmpdir_was_set="y"
+set | grep TMPDIR 1>/dev/null 2>/dev/null || tmpdir_was_set="n"
+if [ "${tmpdir_was_set}" = "y" ]; then
+ [ "${TMPDIR%_*}" = "/tmp/lbmk" ] || tmpdir_was_set="n"
+fi
+if [ "${tmpdir_was_set}" = "n" ]; then
+ export TMPDIR="/tmp"
+ tmpdir="$(mktemp -d -t lbmk_XXXXXXXX)"
+ export TMPDIR="${tmpdir}"
+else
+ export TMPDIR="${TMPDIR}"
+ tmpdir="${TMPDIR}"
+fi
+
x_() {
[ $# -lt 1 ] || ${@} || $err "Unhandled non-zero exit: $@"; return 0
}