From 32da4e319bac527b1ef70f392b5c93d9d4d5ceb4 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 29 Sep 2023 17:23:47 +0100 Subject: merge include/fetch.sh, blobutil.sh, defconfig.sh They are only ever used by script/update/blobs/*, so put them all in blobutil.sh. This cuts down on the number of scripts in lbmk. Signed-off-by: Leah Rowe --- include/fetch.sh | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100755 include/fetch.sh (limited to 'include/fetch.sh') diff --git a/include/fetch.sh b/include/fetch.sh deleted file mode 100755 index 08a1d044..00000000 --- a/include/fetch.sh +++ /dev/null @@ -1,41 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-only -# SPDX-FileCopyrightText: 2023 Leah Rowe - -agent="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0" -dl_path="" - -fetch() -{ - dl_type="${1}" - dl="${2}" - dl_bkup="${3}" - dlsum="${4}" - dl_path="${5}" - _fail="${6}" - - mkdir -p "${dl_path%/*}" || "${_fail}" "fetch: !mkdir ${dl_path%/*}" - - dl_fail="y" - vendor_checksum "${dlsum}" "${dl_path}" && dl_fail="n" - for url in "${dl}" "${dl_bkup}"; do - [ "${dl_fail}" = "n" ] && break - [ -z "${url}" ] && continue - rm -f "${dl_path}" || "${_fail}" "fetch: !rm -f ${dl_path}" - wget --tries 3 -U "${agent}" "${url}" -O "${dl_path}" || \ - continue - vendor_checksum "${dlsum}" "${dl_path}" && dl_fail="n" - done - [ "${dl_fail}" = "y" ] && \ - "${_fail}" "fetch ${dlsum}: matched file unavailable" - - eval "extract_${dl_type}" -} - -vendor_checksum() -{ - if [ "$(sha512sum ${2} | awk '{print $1}')" != "${1}" ]; then - printf "Bad checksum for file: %s\n" "${2}" 1>&2 - rm -f "${2}" || : - return 1 - fi -} -- cgit v1.2.1