From c202dc612e76aa5850bc9e8000832e7085b84840 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 8 Jun 2024 01:55:15 +0100 Subject: vendor.sh: move download logic to lib.sh in future revisions, i will make tarballs become subfiles, to complement submodules. e.g. crossgcc tarballs in coreboot Signed-off-by: Leah Rowe --- include/vendor.sh | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'include/vendor.sh') diff --git a/include/vendor.sh b/include/vendor.sh index b8adc9c8..f4dba0a1 100755 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -3,7 +3,6 @@ # Copyright (c) 2022 Ferass El Hafidi # Copyright (c) 2023-2024 Leah Rowe -_ua="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0" _7ztest="a" e6400_unpack="$PWD/src/bios_extract/dell_inspiron_1100_unpacker.py" @@ -115,20 +114,7 @@ fetch() _dest="${5##*../}" _dl="$vendir/cache/$dlsum" - x_ mkdir -p "${_dl%/*}" - - dl_fail="y" - vendor_checksum "$dlsum" "$_dl" || dl_fail="n" - for url in "$dl" "$dl_bkup"; do - [ "$dl_fail" = "n" ] && break - [ -z "$url" ] && continue - x_ rm -f "$_dl" - curl --location --retry 3 -A "$_ua" "$url" -o "$_dl" || \ - wget --tries 3 -U "$_ua" "$url" -O "$_dl" || continue - vendor_checksum "$dlsum" "$_dl" || dl_fail="n" - done - [ "$dl_fail" = "y" ] && \ - $err "fetch $dlsum: matched file unavailable" + download "$dl" "$dl_bkup" "$_dl" "$dlsum" x_ rm -Rf "${_dl}_extracted" mkdirs "$_dest" "extract_$dl_type" || return 0 @@ -139,13 +125,6 @@ fetch() $err "extract_$dl_type (fetch): missing file: '$_dest'" } -vendor_checksum() -{ - [ "$(sha512sum "$2" | awk '{print $1}')" != "$1" ] || return 1 - printf "Bad checksum for file: %s\n" "$2" 1>&2 - rm -f "$2" || : -} - mkdirs() { e "$1" f && return 1 -- cgit v1.2.1