Package Details: softhsm-git 2.7.0.r0.g13e6e86-1

Git Clone URL: https://aur.archlinux.org/softhsm-git.git (read-only, click to copy)
Package Base: softhsm-git
Description: Software PKCS#11 store
Upstream URL: https://www.opendnssec.org/softhsm/
Licenses: BSD-2-Clause
Conflicts: softhsm
Provides: softhsm
Submitter: Chocobo1
Maintainer: Chocobo1
Last Packager: Chocobo1
Votes: 0
Popularity: 0.000000
First Submitted: 2023-09-11 10:45 (UTC)
Last Updated: 2026-02-18 15:13 (UTC)

Required by (4)

Sources (1)

Latest Comments

Chocobo1 commented on 2026-03-07 14:24 (UTC) (edited on 2026-03-07 14:45 (UTC) by Chocobo1)

Your pkgver function is non-deterministic; on some systems I get an 8 character hash, on others, I get a 7 character hash.

Why is that? I never saw this issue, do you know how to reproduce it?

The VCS packaging guidelines anticipate this, and they suggest to use the following (which indeed does lead to an always-seven-character hash and rest of version number identical):

Are you sure about it? The guideline uses git describe --abbrev=7 and looking at the documentation. It says (emphasis mine):

Instead of using the default number of hexadecimal digits (which will vary according to the number of objects in the repository with a default of 7) of the abbreviated object name, use <n> digits, or as many digits as needed to form a unique object name.

So it seems it isn't deterministic either, it can still be more than 7 digits whenever needed.

And last, I didn't found any mention of requiring exactly 7 digits for the hash part. The Mercurial example even used 12 digits.

rubin55 commented on 2026-03-07 13:43 (UTC) (edited on 2026-03-07 13:44 (UTC) by rubin55)

Your pkgver function is non-deterministic; on some systems I get an 8 character hash, on others, I get a 7 character hash. The VCS packaging guidelines anticipate this, and they suggest to use the following (which indeed does lead to an always-seven-character hash and rest of version number identical):

git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'

The patch to the PKGBUILD:

diff --git a/PKGBUILD b/PKGBUILD
index c099947..26c30a0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
 # Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

 pkgname=softhsm-git
-pkgver=2.7.0.r0.g13e6e86
+pkgver=2.7.0.r1.g9687394
 pkgrel=1
 pkgdesc="Software PKCS#11 store"
 arch=('i686' 'x86_64')
@@ -20,11 +20,7 @@ sha256sums=('SKIP')

 pkgver() {
   cd "SoftHSMv2"
-
-  _tag=$(git tag -l --sort -v:refname | grep -E '^v?[0-9\.]+$' | head -n1)
-  _rev=$(git rev-list --count "$_tag"..HEAD)
-  _hash=$(git rev-parse --short HEAD)
-  printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^v//'
+  git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
 }

 build() {