From b8039ef8387ea8343b029ebf9e27037c11a0060e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Mon, 31 Dec 2018 12:34:10 +0100 Subject: [PATCH] update-check: download each url once --- common/xbps-src/shutils/update_check.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh index e2cdee3d0f..445600a2fe 100644 --- a/common/xbps-src/shutils/update_check.sh +++ b/common/xbps-src/shutils/update_check.sh @@ -5,6 +5,7 @@ update_check() { local update_override=$XBPS_SRCPKGDIR/$XBPS_TARGET_PKG/update local original_pkgname=$pkgname local urlpfx urlsfx + local -A fetchedurls if [ -r $update_override ]; then . $update_override @@ -138,11 +139,19 @@ update_check() { rx=${pattern:-$rx} rx=${rx:-'(?&2 + fi + continue + fi + if [ -n "$XBPS_UPDATE_CHECK_VERBOSE" ]; then echo "fetching $url" 1>&2 fi curl -H 'Accept: text/html,application/xhtml+xml,application/xml,text/plain,application/rss+xml' -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$url" | grep -Po -i "$rx" + fetchedurls[$url]=yes done | tr _ . | sort -Vu |