xbps-src/shutils/update_check.sh: change gitlab check to handle old urls

This commit is contained in:
Piotr Wójcik 2022-05-14 15:36:27 +02:00
parent 36274904cf
commit fddef76fcc

View File

@ -123,7 +123,10 @@ update_check() {
url="https://github.com/$pkgurlname/tags"
rx='/archive/refs/tags/(v?|\Q'"$pkgname"'\E-)?\K[\d.]+(?=\.tar\.gz")';;
*//gitlab.*)
pkgurlname="$(printf %s "$url" | sed 's%/-/*%%g')"
case "$url" in
*/-/*) pkgurlname="$(printf %s "$url" | sed -e 's%/-/.*%%g; s%/$%%')";;
*) pkgurlname="$(printf %s "$url" | cut -d / -f 1-5)";;
esac
url="$pkgurlname/tags"
rx='/archive/[^/]+/\Q'"$pkgname"'\E-v?\K[\d.]+(?=\.tar\.gz")';;
*bitbucket.org*)