From 79273c05d92cc1553851c9d51b142cc93e2ffc13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Mon, 29 Apr 2019 10:25:27 +0200 Subject: [PATCH] update-check: only check newer directories --- common/xbps-src/shutils/update_check.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh index 30982b1351a..8dfc9d6e787 100644 --- a/common/xbps-src/shutils/update_check.sh +++ b/common/xbps-src/shutils/update_check.sh @@ -52,8 +52,18 @@ update_check() { if [ -n "$XBPS_UPDATE_CHECK_VERBOSE" ]; then echo "(folder) fetching $urlpfx" 1>&2 fi + skipdirs= curl -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$urlpfx" | - grep -Po -i "$rx" | xargs -r -n 1 -I @@ printf '%s\n' "${urlpfx}@@${urlsfx}" + grep -Po -i "$rx" | sort -Vru | + while IFS= read -r newver; do + newurl="${urlpfx}${newver}${urlsfx}" + if [ "$newurl" = "$url" ]; then + skipdirs=yes + fi + if [ -z "$skipdirs" ]; then + printf '%s\n' "$newurl" + fi + done fi done | while IFS= read -r url; do