From: Jarod Wilson <[email protected]>

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.g797f.el8.tar.xz
  kernel-4.18.0-374.g797f.el8.src.rpm

The .gSHA field is the first four chars of 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 <[email protected]>

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -49,6 +49,7 @@ FLAVOR=
 CURARCH := $(shell uname -m)
 ARCHCONFIG := $(shell uname -m | sed -e s/x86_64/X86_64/ \
                                     -e s/s390x/S390/ -e s/ppc.*/PPC/ )
+RHEL_EXTRAVERSION=
 
 # rpm information
 SPECFILE:=$(PACKAGE_NAME).spec
@@ -189,6 +190,13 @@ 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(".%s", 
$$(NF)) }' | cut -c 1-6)
+    endif
+  endif
 endif
 
 KVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
@@ -231,6 +239,7 @@ else
   # upstream sources and RHEL specific patches.
   SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0
+  BUILD:=$(BUILD)$(RHEL_EXTRAVERSION)
   ifndef BUILD_SCRATCH_TARGET
     BUILD_SCRATCH_TARGET:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0-test-pesign
   endif

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1735
_______________________________________________
kernel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to