aboutgitcodebugslistschat
path: root/contrib/fedora
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-08-29 14:53:59 +0200
committerStefano Brivio <sbrivio@redhat.com>2022-08-30 19:16:01 +0200
commit7aff403c1e32861961d2ac5ca5ce0a86c855c4c7 (patch)
treed747dd4a2c2b5cf37206a955181ab7a4f2998dac /contrib/fedora
parent9672ab8dd01cd9a2f7c8365f8d497b605dc83c9b (diff)
downloadpasst-7aff403c1e32861961d2ac5ca5ce0a86c855c4c7.tar
passt-7aff403c1e32861961d2ac5ca5ce0a86c855c4c7.tar.gz
passt-7aff403c1e32861961d2ac5ca5ce0a86c855c4c7.tar.bz2
passt-7aff403c1e32861961d2ac5ca5ce0a86c855c4c7.tar.lz
passt-7aff403c1e32861961d2ac5ca5ce0a86c855c4c7.tar.xz
passt-7aff403c1e32861961d2ac5ca5ce0a86c855c4c7.tar.zst
passt-7aff403c1e32861961d2ac5ca5ce0a86c855c4c7.zip
fedora: Adopt versioning guideline for snapshots
The "Simple versioning" scheme: https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_simple_versioning probably doesn't apply to passt, given that upstream git tags are not really releases. Switch to the "Snapshots" versioning scheme: https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_snapshots Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'contrib/fedora')
-rw-r--r--contrib/fedora/rpkg.macros7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/fedora/rpkg.macros b/contrib/fedora/rpkg.macros
index 2032034..df9dfc5 100644
--- a/contrib/fedora/rpkg.macros
+++ b/contrib/fedora/rpkg.macros
@@ -12,7 +12,10 @@
# Author: Stefano Brivio <sbrivio@redhat.com>
function git_version {
- printf "0.git.%s.%s" "$(date -u -I | tr - _)" "$(git rev-parse --short HEAD)"
+ __commit="$(git rev-parse --short "${1:-HEAD}")"
+ __date="$(git log --pretty="format:%cI" "${__commit}" -1)"
+
+ printf "0^%s.g%s" "$(date -uI -d "${__date}" | tr -d -)" "${__commit}"
}
function git_head {
@@ -28,7 +31,7 @@ function passt_git_changelog_entry {
__date="$(git log --pretty="format:%cI" "${__to}" -1)"
__author="$(git log -1 --pretty="format:%an <%ae>" ${__to} -- contrib/fedora)"
- printf "* %s %s - %s\n" "$(date "+%a %b %e %Y" -d "${__date}")" "${__author}" "0.git.${1}-0"
+ printf "* %s %s - %s\n" "$(date "+%a %b %e %Y" -d "${__date}")" "${__author}" "$(git_version "${__to}")-1"
IFS='
'