aboutsummaryrefslogtreecommitdiff
path: root/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh
diff options
context:
space:
mode:
authorDevan Carpenter <devan@taler.net>2024-08-25 09:54:28 -0500
committerDevan Carpenter <devan@taler.net>2024-08-25 10:55:43 -0500
commit830afe1d13b1fb60d745fface72419ec93494811 (patch)
tree0a6b15ba64b8d82736c32664f01442f4d9585c1e /contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh
parent7e12f12fe9f50ebe948e5c02e823e7ae2366c5a5 (diff)
Revert "unify debian packaging logic"
This reverts commit d5bb85938a28be816f3ec7ead1f01a4c88397650. This commit broke several jobs. Will reapply changes selectively in subsequent commit(s).
Diffstat (limited to 'contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh')
-rwxr-xr-xcontrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh b/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh
new file mode 100755
index 000000000..52031b23a
--- /dev/null
+++ b/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -ex
+
+BRANCH=$(git name-rev --name-only HEAD)
+if [ -z "${BRANCH}" ]; then
+ exit 1
+else
+ # "Unshallow" our checkout, but only our current branch, and exclude the submodules.
+ git fetch --no-recurse-submodules --tags --depth=1000 origin "${BRANCH}"
+ RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --exclude '*-dev*' --always --abbrev=0 HEAD || exit 1)
+ commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
+ if [ "${commits}" = "0" ]; then
+ git describe --tag HEAD | sed -r 's/^v//' || exit 1
+ else
+ echo $(echo ${RECENT_VERSION_TAG} | sed -r 's/^v//')-${commits}-$(git rev-parse --short=8 HEAD)
+ fi
+fi