Skip to content

Commit

Permalink
Use rpm.ds(hdr) instead of now removed hdr.dsFromHeader()
Browse files Browse the repository at this point in the history
Fixes: #1203
Closes: #1223
  • Loading branch information
praiskup authored and Conan-Kudo committed Sep 14, 2023
1 parent 92ef8cf commit c15bd39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mock/py/mockbuild/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def installSpecDeps(self, spec_file):
try:
# pylint: disable=no-member
spec_file = util.host_file(spec_file)
spec = rpm.spec(spec_file).sourceHeader.dsFromHeader()
spec = rpm.ds(rpm.spec(spec_file).sourceHeader, "requires")
self.uid_manager.becomeUser(0, 0)
for i in range(len(spec)): # pylint: disable=consider-using-enumerate
requirement_name = spec[i][2:]
Expand Down
7 changes: 7 additions & 0 deletions releng/release-notes-next/rpm-ds.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The `--installdeps foo.spec` feature is implemented using the RPM Python API.
Previously we used the method `hdr.dsFromHeader()` to get the list of
`BuildRequires`. This method has been removed from the Python RPM API (rpm
v4.19) in favor of the long-enough existing `rpm.ds(hdr, ...)` method. Mock
[has started using `rpm.ds()` API call][PR#1223] to fix the [`AttributeError:
'rpm.hdr' object has no attribute 'dsFromHeader'`][issue#1203] traceback on
newer systems (e.g. Fedora 40+).

0 comments on commit c15bd39

Please sign in to comment.