From bd7536e1033abae2e3b0ea52b3d877e0686cad6f Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 13 Apr 2023 18:41:32 +0200 Subject: [PATCH] Fix detection for weird tags Signed-off-by: Knut Ahlers --- update_version.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/update_version.sh b/update_version.sh index 0183100..5aac41c 100755 --- a/update_version.sh +++ b/update_version.sh @@ -5,19 +5,20 @@ PKG=$(awk -F '=' '/^pkgname=/{ print $2 }' PKGBUILD) # Get latest version VER=$(git ls-remote --tags --sort -v:refname https://github.com/mvdan/gofumpt.git | - head -n1 | - grep -Eo '[0-9.]+$') + grep -E '/tags/v[0-9.]+$' | + head -n1 | + grep -Eo '[0-9.]+$') # Insert latest version into PKGBUILD and update hashes sed -i \ - -e "s/^pkgver=.*/pkgver=${VER}/" \ - -e 's/pkgrel=.*/pkgrel=1/' \ - PKGBUILD + -e "s/^pkgver=.*/pkgver=${VER}/" \ + -e 's/pkgrel=.*/pkgrel=1/' \ + PKGBUILD # Check whether this changed anything if (git diff --exit-code PKGBUILD); then - echo "Package ${PKG} has most recent version ${VER}" - exit 0 + echo "Package ${PKG} has most recent version ${VER}" + exit 0 fi updpkgsums