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

The `/-/` sequence is always between e.g. archive and the repo path,
so this should work reliably for distfiles.
If gitlab is used only as a homepage, this still wroks if homepage
points to the base repo (which it usually does)
This commit is contained in:
John 2021-03-15 19:12:50 +01:00 committed by Piotr
parent e6da5a4b29
commit 36274904cf

View File

@ -123,7 +123,7 @@ 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" | cut -d/ -f1-5)"
pkgurlname="$(printf %s "$url" | sed 's%/-/*%%g')"
url="$pkgurlname/tags"
rx='/archive/[^/]+/\Q'"$pkgname"'\E-v?\K[\d.]+(?=\.tar\.gz")';;
*bitbucket.org*)