From 89c7d2ae30a43ba2960ce14cddd50f8d8a7da92f Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Oct 05 2018 13:51:31 +0000 Subject: Trim EXTRAVERSION in the Makefile on CI builds The CI build currently adds the full git commit hash to the release of the RPM it builds. This breaks the kernel build as the EXTRAVERSION cannot exceed 64 characters. This sets the EXTRAVERSION to whatever the release was minus ".pr.". Signed-off-by: Jeremy Cline --- diff --git a/kernel.spec b/kernel.spec index 375f026..7a91501 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1235,7 +1235,9 @@ BuildKernel() { %endif # make sure EXTRAVERSION says what we want it to say - perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}.%{_target_cpu}${Flav}/" Makefile + # Trim the release if this is a CI build, since KERNELVERSION is limited to 64 characters + ShortRel=$(python3 -c "import re; print(re.sub(r'\.pr\.[0-9A-Fa-f]{32}', '', '%{release}'))") + perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -${ShortRel}.%{_target_cpu}${Flav}/" Makefile # if pre-rc1 devel kernel, must fix up PATCHLEVEL for our versioning scheme %if !0%{?rcrev}