~sircmpwn/sr.ht-dev

1

[PATH sr.ht-apkbuilds] Fix mercurial package versioning

Details
Message ID
<20240330215623.3402030-1-ludovic@chabant.com>
DKIM signature
pass
Download raw message
Patch: +3 -3
Use `hg id -r .` to remove the working dir from the distance, and
compare this distance with 1 instead of 0 because we always get
a tagging commit in addition to the tagged commit.

This now matches the logic inside hg.sr.ht/.builds/alpine.yml
---

I'm not even sure how this ever worked correctly? Am I missing
something?

 pkgkit | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkgkit b/pkgkit
index 4afc8e9..a3f21c1 100755
--- a/pkgkit
+++ b/pkgkit
@@ -182,10 +182,10 @@ print_pkgver() {
		fi
	elif [ -d .hg ]
	then
		pkgver=$(hg id -T '{latesttag}')
		if [ "$(hg id -T '{latesttagdistance}')" -ne 0 ]
		pkgver=$(hg id -r . -T '{latesttag}')
		if [ "$(hg id -r . -T '{latesttagdistance}')" -ne 1 ]
		then
			pkgver="$(hg id -T '{latesttag}_hg{sub("-", "", date|shortdate)}')"
			pkgver="$(hg id -r . -T '{latesttag}_hg{sub("-", "", date|shortdate)}')"
		fi
	else
		pkgver=unknown_0000
-- 
2.34.1
Details
Message ID
<D07V1IM8WJ3U.38NHXAB4PSFUV@cmpwn.com>
In-Reply-To
<20240330215623.3402030-1-ludovic@chabant.com> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/sr.ht-apkbuilds
   b2f30e7..5b554a3  master -> master
Reply to thread Export thread (mbox)