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>
This commit is contained in:
Jeremy Cline 2018-10-04 12:41:41 -04:00
parent 64591e70e6
commit 89c7d2ae30
No known key found for this signature in database
GPG Key ID: 9223308FA9B246DB
1 changed files with 3 additions and 1 deletions

View File

@ -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}