summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-12 15:32:50 +0100
committerLeah Rowe <leah@libreboot.org>2025-05-12 15:32:50 +0100
commit89cd828e87c8a98e37f689adafa32d0f2d404c39 (patch)
treeba4a63a5b919d8115e663482a62888edc2879049
parent308a9ab1e17e3c3fd5acbbe95d7f2c598344870b (diff)
lib.sh: move _ua to try_file()
it's only used there Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/lib.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/lib.sh b/include/lib.sh
index c0adc7a6..32f81cd0 100644
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -47,8 +47,6 @@ rmgit()
# if copying locally, it can only copy a file.
xbmkget()
{
- _ua="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
-
_dlop="curl" && [ $# -gt 4 ] && _dlop="$5"
x_ mkdir -p "${3%/*}" "$XBMK_CACHE/file"
for url in "$1" "$2"; do
@@ -58,6 +56,8 @@ xbmkget()
try_file()
{
+ _ua="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
+
cached="$XBMK_CACHE/file/$6"
dl_fail="n" # 1 url, 2 url backup, 3 destination, 4 checksum
bad_checksum "$6" "$cached" 2>/dev/null && dl_fail="y"