summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
authorRunar Borge <runar@borge.nu>2020-05-09 22:23:14 +0200
committerRunar Borge <runar@borge.nu>2020-05-09 22:56:51 +0200
commit2c3e4696b3e223a9346552354a4fe40a76758555 (patch)
treebc9677d0ab9ae0c372c3e25d7dc7c1cb2ccb6ef7 /debian/rules
parent4ca0e563861f1d0ebf99afc012a9b95d9492e399 (diff)
downloadvyos-1x-2c3e4696b3e223a9346552354a4fe40a76758555.tar.gz
vyos-1x-2c3e4696b3e223a9346552354a4fe40a76758555.zip
T2267: Versioning: Update version tag from GIT repo
This commit will update the version field of the generated deb package from the git repo version tag. the tag needs to be in the format "vyos/<version>" eg. "vyos/1.2.5" 1.2.5 is then used as the version The version field will be one of the following syntaxes: on a commit: - <version>-<commits from tag>-g<commit id> eg. 1.2.5-4-g23232343 on a commit with unstaged changes: - <version>-<commits from tag>-g<commit id>+dirty eg. 1.2.5-4-g23232343+dirty This will make it clear what state the repo was in when the package was generated. It is possible to remove the number and commit id on the tagged commit, but i've decided to use the same format for all commits tagged or not. as for now the tagged commit will be sufixed with -0-g<commit id> if no valid tag is recieved from `git describe`, the script uses a 0.0 version number. The changelog is also updated to reflext that we dont use it and refers to the Git Changelog and vyos release-notes
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules3
1 files changed, 3 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
index 144132389..3e408b538 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,6 +15,9 @@ SERVICES_DIR := usr/libexec/vyos/services
%:
dh $@ --with python3, --with quilt
+override_dh_gencontrol:
+ dh_gencontrol -- -v$(shell (git describe --tags --long --match 'vyos/*' --dirty 2>/dev/null || echo 0.0-no.git.tag) | sed -E 's%vyos/%%' | sed -E 's%-dirty%+dirty%')
+
override_dh_auto_build:
make all