From 7c60bd841aecdf06e0837f52ba92ba0211b03a8b Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Wed, 10 Jan 2024 20:09:19 -0700 Subject: [PATCH] proto: Strip initial "v" from Git tag names Many projects use tags that are the version number prefixed with "v". In particular, GitHub suggests and encourages this naming convention. Include code in the example to remove the "v" so that the VCS package version number is comparable to the regular package version number. Signed-off-by: Alex Henrie --- proto/PKGBUILD-vcs.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/PKGBUILD-vcs.proto b/proto/PKGBUILD-vcs.proto index c89bb50b..0d802b73 100644 --- a/proto/PKGBUILD-vcs.proto +++ b/proto/PKGBUILD-vcs.proto @@ -43,7 +43,7 @@ pkgver() { printf "r%s" "$(bzr revno)" # Git, tags available - printf "%s" "$(git describe --tags --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')" + printf "%s" "$(git describe --tags --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g;s/^v//')" # Git, no tags available printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"