From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH 2/7] fedora: Adopt versioning guideline for snapshots Date: Mon, 29 Aug 2022 17:17:04 +0200 Message-ID: <20220829151709.2650896-3-sbrivio@redhat.com> In-Reply-To: <20220829151709.2650896-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7516878305874279865==" --===============7516878305874279865== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The "Simple versioning" scheme: https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_simp= le_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/#_simp= le_versioning Suggested-by: Daniel P. Berrang=C3=A9 Signed-off-by: Stefano Brivio --- contrib/fedora/rpkg.macros | 7 +++++-- 1 file 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 =20 function git_version { - printf "0.git.%s.%s" "$(date -u -I | tr - _)" "$(git rev-parse --short HEAD= )" + __commit=3D"$(git rev-parse --short "${1:-HEAD}")" + __date=3D"$(git log --pretty=3D"format:%cI" "${__commit}" -1)" + + printf "0^%s.g%s" "$(date -uI -d "${__date}" | tr -d -)" "${__commit}" } =20 function git_head { @@ -28,7 +31,7 @@ function passt_git_changelog_entry { __date=3D"$(git log --pretty=3D"format:%cI" "${__to}" -1)" __author=3D"$(git log -1 --pretty=3D"format:%an <%ae>" ${__to} -- contrib/f= edora)" =20 - 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" =20 IFS=3D' ' --=20 2.35.1 --===============7516878305874279865==--