From: Jarod Wilson <jarod(a)redhat.com>
redhat: indicate HEAD state in tarball/rpm name
For the non-Fedora (RHEL) case, we are looking to move to a setup where we
include Merge Requests as soon as they are ready, and thus the head of
main may not always be a tagged build. This gives some indication to
someone basing a build on main that they're basing their work on the tree
at a state between tagged builds.
If HEAD is a tagged build, as usual, you should see:
linux-4.18.0-374.el8.tar.xz
kernel-4.18.0-374.el8.src.rpm
If HEAD has additional commits, with this change, you should see:
linux-4.18.0-374.p1.g797fdad2a6e5.el8.tar.xz
kernel-4.18.0-374.p1.g797fdad2a6e5.el8.src.rpm
The .pX field is "X patches since tag" and the .gSHA field is the HEAD sha
of the branch after adding your local changes.
This is directly related to:
https://gitlab.com/redhat/rhel/src/kernel/rhel-8/-/merge_requests/2405
Signed-off-by: Jarod Wilson <jarod(a)redhat.com>
diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -189,6 +189,14 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
endif
else
SNAPSHOT:=0
+ EXACT_TAG:=$(shell $(GIT) describe --exact-match 2>/dev/null)
+ ifeq ($(EXACT_TAG),)
+ _TAG:=$(shell $(GIT) describe 2>/dev/null)
+ ifneq ($(_TAG),)
+ RHEL_EXTRAVERSION:=$(shell echo $(_TAG) | awk -F- '{
printf(".p%d.%s", $$(NF-1),$$(NF)) }')
+ BUILD:=$(BUILD)$(RHEL_EXTRAVERSION)
+ endif
+ endif
endif
KVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1735