summaryrefslogtreecommitdiff
path: root/include/vendor.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-28 23:10:22 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-28 23:10:22 +0100
commitf2d53eb842d7d843149b004c51c23739521f732d (patch)
tree6c1d38a45abbfdf86f2e50b88ca42b877a60116e /include/vendor.sh
parent85c2eb0f7ce21841ed0bf110ab91fd627e5735c8 (diff)
vendor.sh: condense fetch() a bit
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/vendor.sh')
-rwxr-xr-xinclude/vendor.sh6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/vendor.sh b/include/vendor.sh
index cb06ec9d..36bea3e3 100755
--- a/include/vendor.sh
+++ b/include/vendor.sh
@@ -92,8 +92,7 @@ fetch()
[ "$5" = "/dev/null" ] && return 0
[ "${5# }" = "$5" ] || $err "fetch: space not allowed in _dest: '$5'"
[ "${5#/}" = "$5" ] || $err "fetch: absolute path not allowed: '$5'"
- _dest="${5##*../}"
- _dl="$vendir/cache/$dlsum"
+ _dest="${5##*../}"; _dl="$vendir/cache/$dlsum"
download "$dl" "$dl_bkup" "$_dl" "$dlsum"
@@ -102,8 +101,7 @@ fetch()
eval "extract_$dl_type"
set -u -e
- [ -f "$_dest" ] && return 0
- $err "extract_$dl_type (fetch): missing file: '$_dest'"
+ e "$_dest" f missing && $err "!extract_$dl_type"; return 0
}
mkdirs()