summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Cline <jcline@redhat.com>2018-10-04 12:41:41 -0400
committerJeremy Cline <jcline@redhat.com>2018-10-05 09:51:31 -0400
commit89c7d2ae30a43ba2960ce14cddd50f8d8a7da92f (patch)
tree17522e0504b669165dedd4617bbdaca00c643a0e
parent64591e70e69cd600faa235d8f619af58c5efaee0 (diff)
downloadkernel-89c7d2ae30a43ba2960ce14cddd50f8d8a7da92f.tar.gz
kernel-89c7d2ae30a43ba2960ce14cddd50f8d8a7da92f.tar.xz
kernel-89c7d2ae30a43ba2960ce14cddd50f8d8a7da92f.zip
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.<hash>". Signed-off-by: Jeremy Cline <jcline@redhat.com>
-rw-r--r--kernel.spec4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel.spec b/kernel.spec
index 375f026f5..7a91501b5 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}