summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-09-03 21:38:16 +0200
committerChristian Breunig <christian@breunig.cc>2025-09-03 21:38:16 +0200
commit562c21cb80c150337a737894617678a09bf3a560 (patch)
tree4131caaf76147b426b4b3bc527cbae23c2812c45
parentb1b4545cb7984cd3cdf42554ab2b28acd1ecb6cb (diff)
downloadvyos-1x-562c21cb80c150337a737894617678a09bf3a560.tar.gz
vyos-1x-562c21cb80c150337a737894617678a09bf3a560.zip
Debian: T7762: extend package version with a number always counting up
This extends commit 53d8ed6cc01e ("Debian: T7762: adjust vyos-1x package version to not mention 1.5 in any way") with a counter that counts the number of commits since the beginning to become HEAD. It kind of mimics "git describe --tags" where commits after the last Git tag are counted. Why do we need it? It's better for sorting multiple revisions of the vyos-1x package, as we are unable to sort using a commit ID which was the commit before one or another. Packages are now named e.g.: vyos-1x_999.0-12876-gb1b4545cb_amd64.deb vyos-1x-aws_999.0-12876-gb1b4545cb_all.deb vyos-1x-dbgsym_999.0-12876-gb1b4545cb_amd64.deb vyos-1x-smoketest_999.0-12876-gb1b4545cb_all.deb vyos-1x-vmware_999.0-12876-gb1b4545cb_all.deb Meaning it is the 12876th commit since repo start and the commit ID used for the build is b1b4545cb.
-rwxr-xr-xdebian/rules3
1 files changed, 2 insertions, 1 deletions
diff --git a/debian/rules b/debian/rules
index 69483e5fd..83091a88a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,6 +22,7 @@ DEB_TARGET_ARCH := $(shell dpkg-architecture -qDEB_TARGET_ARCH)
# Base version prefix from debian/changelog
BASE_VERSION := 999.0
COMMIT_ID := $(shell echo -n g && git rev-parse --short HEAD)
+COMMIT_COUNT := $(shell git rev-list HEAD --count)
DIRTY_FLAG := $(shell ! git diff --quiet || ! git diff --cached --quiet && echo -dirty || echo)
%:
@@ -32,7 +33,7 @@ DIRTY_FLAG := $(shell ! git diff --quiet || ! git diff --cached --quiet && echo
override_dh_strip_nondeterminism:
override_dh_gencontrol:
- dh_gencontrol -- -v$(BASE_VERSION)-$(COMMIT_ID)$(DIRTY_FLAG)
+ dh_gencontrol -- -v$(BASE_VERSION)-$(COMMIT_COUNT)-$(COMMIT_ID)$(DIRTY_FLAG)
override_dh_auto_build:
make all