diff options
author | Leah Rowe <leah@libreboot.org> | 2025-04-12 22:24:34 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-04-12 22:32:51 +0100 |
commit | 023f9cf0498f28aa8d19de251e3f62639afd22f9 (patch) | |
tree | 6a3ca2516e47ad01b29f582cf51c44b5f2c77415 | |
parent | cb3253befb9e3424ff009e3f4c894b1609dc3db0 (diff) |
lib.sh: tidy up the error handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r-- | include/lib.sh | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/include/lib.sh b/include/lib.sh index 19bd9357..44b6a138 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -128,12 +128,9 @@ if [ -z "${TMPDIR+x}" ]; then export TMPDIR="/tmp" export TMPDIR="$(mktemp -d -t xbmk_XXXXXXXX)" touch lock || $err "cannot create 'lock' file" - rm -Rf "$XBMK_CACHE/xbmkpath" "$XBMK_CACHE/gnupath" || \ - $err "cannot remove xbmkpath" - mkdir -p "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath" || \ - $err "cannot create gnupath" - export PATH="$XBMK_CACHE/xbmkpath:$XBMK_CACHE/gnupath:$PATH" || \ - $err "Can't create gnupath/xbmkpath" + x_ rm -Rf "$XBMK_CACHE/xbmkpath" "$XBMK_CACHE/gnupath" + x_ mkdir -p "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath" + export PATH="$XBMK_CACHE/xbmkpath:$XBMK_CACHE/gnupath:$PATH" ( # set up python v3.x in PATH, in case it's not set up correctly. # see code above that detected the correct python3 command. @@ -241,8 +238,7 @@ download() dl_fail="n" # 1 url, 2 url backup, 3 destination, 4 checksum vendor_checksum "$4" "$cached" 2>/dev/null && dl_fail="y" [ "$dl_fail" = "n" ] && e "$3" f && return 0 - mkdir -p "${3%/*}" "$XBMK_CACHE/file" || \ - $err "!mkdir '$3' '$XBMK_CACHE/file'" + x_ mkdir -p "${3%/*}" "$XBMK_CACHE/file" for url in "$1" "$2"; do [ "$dl_fail" = "n" ] && break [ -z "$url" ] && continue |