Description of problem: No packages can be built. buildSRPMFromSCM job fails with: DEBUG util.py:602: error: lua script failed: [string "%prein(crypto-policies-20200527-3.gitb234a47.fc33.noarch)"]:19: attempt to call a nil value DEBUG util.py:600: Error in PREIN scriptlet in rpm package crypto-policies DEBUG util.py:602: error: crypto-policies-20200527-3.gitb234a47.fc33.noarch: install failed Version-Release number of selected component (if applicable): crypto-policies-20200527-3.gitb234a47.fc33 How reproducible: build anything in koji Actual results: everything is on fire Expected results: packages build fine
crypto-policies-20200527-3.gitb234a47.fc33 has been untagged.
$ ilua Jupyter console 6.1.0 ILua 0.2.1 In [1]: policy = "DEFAULT" In [2]: posix.files("%{_datarootdir}/crypto-policies/"..policy) Out[2]: nil "%{_datarootdir}/crypto-policies/DEFAULT: No such file or directory" 2.0 The %{_datarootdir} macro is not expanded. Nor defined BTW: In [3]: posix.files(rpm.expand("%{_datarootdir}/crypto-policies/"..policy)) Out[3]: nil "%{_datarootdir}/crypto-policies/DEFAULT: No such file or directory" 2.0 In [4]: rpm.expand("%{_datarootdir}") Out[4]: "%{_datarootdir}"
Scratch that, the macro is expanded during build.
I think the problem simply is that /usr/share/crypto-policies/ is part of crypto-policies package and when the package is installed for the first time, the files are missing. The %pre script should only run on update and/or should do nothing if the files are not present yet.
No, the script actually should just be moved to %post.
Just a stupid mistake.
There were a few more changes needed but now I tested installing it in mock chroot without crypto-policies already installed, so hopefully no more buildroot breakage.