On my Fedora 33 with RPM 4.16.0 our 'rpmscpec' fails when running repo/rebuild to refresh the repo/cache. The repo/rebuild script doesn't show these errors from rpmspec, but if I run it manually I see this error: > $ repo/rpmspec --arch armhf > /local/home/samuel/svn/cenbuild/repo/../build/prelink.spec > error: bare words are no longer supported, please use "...": armhf == i386 || armhf == x86_64 > error: ^ > error: /opt/cendio-build/lib/utils/macros:73: bad %if condition: armhf == i386 || armhf == x86_64 As mentioned in the error, the fix is to add quotation marks around the arguments. This is likely a problem in many of our spec files all around.
The effect of this bug is that cenbuild can't update the cache on systems with newer versions of RPM. This generally means that you can't build stuff.
There's a tool called 'rpmlint' that can be used to verify the syntax in RPM spec files. However, due to some special macros we have in cenbuild I had to make this temporary modification to be able to run rpmlint: +++ /opt/cendio-build/lib/utils/macros 2020-12-16 12:49:16.958148164 +0100 @@ -60,7 +60,7 @@ # We need to make sure we have an arch defined %if "%{?_cendio_arch}" == "" -%{error:You need to specify a target architecture (_cendio_arch)} +%global _cendio_arch x86_64 %endif I then verified that rpmlint does indeed complain about "bare words" not being supported any longer. It complains about a lot more stuff however aside from that error. In all 316 spec files in cenbuild it found 116 other errors and 695 warnings. Most of them come from the fact that we have written spec file comments in the wrong way. Inline comments are not allowed in spec files.
rpmlint can be run like this: find . -name "*.spec" | xargs rpmlint
The usage of bare words is now gone and both sides of the "==" and "!=" comparisons are now enclosed in quotes. Furthermore, after fixing the spec file comments we are now down to 47 errors according to rpmlint. I'll wait and see if the rebuild of the build system goes through before considering the bug resolved.
The rebuild of the build system was successful. The changes were supposed to have no effect on older systems, and to me this indicates that things work as intended.
Changes look good. I cannot find anything overlooked when I grep for comparisons. Complete rebuild in Jenkins also passed fine. I also forced a reparse of all .spec files and it seems to have read everything just fine.
This change has been committed but hasn't actually been rolled out as an update: > error: bare words are no longer supported, please use "...": i386 == i386 || i386 == x86_64 > error: ^ > error: /opt/cendio-build/lib/utils/macros:73: bad %if condition: i386 == i386 || i386 == x86_64
A new version of cendio-build-utils have now been built on chavez and then pushed out to our repos.
Confirmed working fine now on Fedora 33.