From 3bc1817ed98d0da6f0e81ea7fe3ccc1d3803f844 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 19 Jul 2019 16:46:48 +0200 Subject: Workaround invalid download checksum files --- core/includes/downloader.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/includes/downloader.inc b/core/includes/downloader.inc index b75272e0..3596fa58 100644 --- a/core/includes/downloader.inc +++ b/core/includes/downloader.inc @@ -40,6 +40,9 @@ download () { for f in sha256sums.asc SHA256SUMS md5sums.asc MD5SUMS metadata.xml.gz ""; do [ -z "$f" ] && break wget -O "$tmpfile" "$path/$f" || continue + # Some ret^W less smart companies decide to just 302 requests for non-existing files/pages + [ "$( stat -c %s "$tmpfile" )" -lt 100000 ] || continue + [ "$( grep -c '<' "$tmpfile" )" -lt 10 ] || continue if [ "$f" = "metadata.xml.gz" ]; then sum=$( gzip -d < "$tmpfile" | grep '.*' | sed -r 's/<[^>]*>//g' ) [ -z "$sum" ] && perror "Did not find sha256 in $f" -- cgit v1.2.3-55-g7522