summaryrefslogtreecommitdiff
path: root/include/lib.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-05 20:38:19 +0100
committerLeah Rowe <leah@libreboot.org>2025-05-05 20:38:19 +0100
commit17d826d3a9614fea2bc87d8203b7f07fe4b7fb54 (patch)
treea5d4cd6c90bfcf17acca851b733386e9fc5e5353 /include/lib.sh
parentf98e34a24dd21ebafbfac2e019d3a4bc1cf500cb (diff)
lbmk: Replace err with much simpler implementation
The current implementation is insanely over-engineered, and completely unnecessary. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/lib.sh')
-rw-r--r--include/lib.sh22
1 files changed, 0 insertions, 22 deletions
diff --git a/include/lib.sh b/include/lib.sh
index 2c28b112..e83170ee 100644
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -184,28 +184,6 @@ x_()
err()
{
set -u -e
-
- xbmk_err_val=0
- real_err="" && [ -n "${xbmk_err+x}" ] && real_err="$xbmk_err"
-
- if [ -z "$real_err" ]; then
- printf "WARNING: err not set. Defaulting to 'err_'\n" 1>&2
- real_err="err_"
- fi
-
- (
- $real_err "$@" || err_ "Error function '$real_err' *returned* 1"
- err_ "Error function '$real_err' didn't exit"
- exit 1 # just in case!
- ) || xbmk_err_val=1 # otherwise, it wrongly did exit 0, not exit 1
-
- [ $xbmk_err_val -eq 0 ] && err_ "Error function '$real_err' did exit 0"
- exit 1 # just in case!
-}
-
-err_()
-{
- [ $# -lt 1 ] && printf "ERROR (but no error message provided)\n" 1>&2
[ $# -lt 1 ] || printf "ERROR %s: %s\n" "$0" "$1" 1>&2 || :
exit 1
}