From 906f339d6afa660004e36b814b508d4435035437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Mon, 29 Apr 2019 10:26:49 +0200 Subject: [PATCH] update-check: generalize checking version directories --- common/xbps-src/shutils/update_check.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh index 8dfc9d6e787..07b4ca20794 100644 --- a/common/xbps-src/shutils/update_check.sh +++ b/common/xbps-src/shutils/update_check.sh @@ -36,15 +36,19 @@ update_check() { rx= urlpfx="${url}" urlsfx= + dirpfx= case "$url" in - *download.kde.org/stable/applications/*|*download.kde.org/stable/frameworks/*|*download.kde.org/stable/plasma/*|\ - *download.kde.org/stable/kdevelop/*|*download.kde.org/stable/krita/*|*download.kde.org/stable/clazy/*|\ - *download.kde.org/stable/digikam/*|*download.kde.org/stable/phonon/*) - urlpfx="${url%%${version%.*}*}" - urlsfx="${url##${urlpfx}${version%.*}}" - urlsfx="${urlsfx#.*/}" - urlsfx="/${urlsfx#/}" - rx='href="\K[\d\.]+(?=/")' + *) + vdpfx=${vdprefix:-"|v|\\Q$pkgname\\E"} + vdsfx=${vdsuffix:-"|\\.x"} + match=$(grep -Po "^[^/]+//[^/]+(/.+)?/($vdpfx)(?=[-_.0-9]*[0-9](?