update-check: only check newer directories

This commit is contained in:
Piotr Wójcik 2019-04-29 10:25:27 +02:00 committed by Enno Boland
parent bb0b85060c
commit 79273c05d9
1 changed files with 11 additions and 1 deletions

View File

@ -52,8 +52,18 @@ update_check() {
if [ -n "$XBPS_UPDATE_CHECK_VERBOSE" ]; then if [ -n "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
echo "(folder) fetching $urlpfx" 1>&2 echo "(folder) fetching $urlpfx" 1>&2
fi fi
skipdirs=
curl -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$urlpfx" | 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 fi
done | done |
while IFS= read -r url; do while IFS= read -r url; do