summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-09-11 22:01:15 +0200
committerGitHub <noreply@github.com>2025-09-11 22:01:15 +0200
commit7d75763655b641c291d58ecc27be8173d0260411 (patch)
treeff4bc3531d4cbafeddd9dacd2f65018cfb5f3d27
parentdf52871a31c7658ccc6c465d4beb9c17cc09e8a5 (diff)
parentd7d15891d83d233222d9d17ed5d8abc6b8f69a55 (diff)
downloadvyos-1x-7d75763655b641c291d58ecc27be8173d0260411.tar.gz
vyos-1x-7d75763655b641c291d58ecc27be8173d0260411.zip
Merge pull request #4713 from c-po/reapply-pkg-version
Debian: T7762: re-apply extend package version with a number always counting up
-rwxr-xr-xdebian/rules8
1 files changed, 7 insertions, 1 deletions
diff --git a/debian/rules b/debian/rules
index 2cb32b839..67bbcfa5e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -29,6 +29,12 @@ SERVICES_DIR := usr/libexec/vyos/services
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)
+
%:
dh $@ --with python3, --with quilt
@@ -37,7 +43,7 @@ DEB_TARGET_ARCH := $(shell dpkg-architecture -qDEB_TARGET_ARCH)
override_dh_strip_nondeterminism:
override_dh_gencontrol:
- dh_gencontrol -- -v$(shell (git describe --tags --long --match 'vyos/*' --match '1.4.*' --dirty 2>/dev/null || echo 0.0-no.git.tag) | sed -E 's%vyos/%%' | sed -E 's%-dirty%+dirty%')
+ dh_gencontrol -- -v$(BASE_VERSION)-$(COMMIT_COUNT)-$(COMMIT_ID)$(DIRTY_FLAG)
override_dh_auto_build:
make all