When trying to build new packages on Fedora 39 I get the following error message: > AttributeError: 'rpm.hdr' object has no attribute 'dsOfHeader' This method has been deprecated since RPM v.4.8 and has now been removed as of Fedora 39. For our use case, the ds (dependency set) we get from header objects seems to only be used to read out the epoch:version-release, the EVR, of the package that the header belongs to, and we need to find an alternative to the deprecated way of doing this so that we can build our cenbuild packages.
There are a few alternatives to the deprecated method. Given that we have a package header - hdr, then the same EVR-string can be produced by either of: 1. rpm.ds(hdr, rpm.RPMTAG_NEVR).EVR() > This is another way of generating the same dependency set as we previously > did with hdr.dsOfHeader(). 2. rpm.ds(hdr, 'nevr').EVR() > Same as above. 3. hdr[rpm.RPMTAG_EVR] > Fetch EVR directly from the header 4. hdr['evr'] > Same as above. Since all of these produce equivalent output, we might as well choose an alternative that makes the code more readable, which to me is either of point 3 or point 4. It also seems unnecessary to transform the header into a different data structure before fetching data that is already available on the header itself.
We also need to take into account that rebuild.py needs to be able to run on both our workstations (Fedora with modern libs) and on RHEL 8. All the alternatives in comment 1 work on both Fedora 39 and on RHEL 8.
The rebuild.py script has now been updated to work on Fedora 39.
I took a look at the components of ThinLinc that handle RPMs, and we are not using the builtin rpm-module there. We are instead using subprocesses to run package operations directly with the system's own rpm-command. This means that we are very unlikely to run into deprecation issues when running e.g. the ThinLinc installer.
> MUST: > * It should be possible to build our cenbuild packages on: > - Fedora 39 > - RHEL 8 I made a simple script which tested that the four alternatives in comment 1 had the same output as hdr.dsOfHeader().EVR() on RHEL 8. Then I ran the same script on Fedora 39 and saw that all the alternatives worked there as well. I chose hdr['evr'] as a substitute for hdr.dsOfHeader().EVR(), since it, to me, is the most readable and most in line with other accesses to properties on the headers in rebuild.py. Lastly, I verified that building packages on both Fedora 39 and RHEL 8 works after updates to rebuild.py.
Since both RHEL 8 and Fedora 39 had been tested in the previous comment, I decided to test cenbuild on RHEL 9. I tested building package docbook-xsl-x86_64 on RHEL 9. A new build was still only triggered when altering the version or release number. (Note that bug 8069 is present on a fresh RHEL 9 as well.) I looked through the commits, they look good and minimal. Closing.