From d6980fdbcc53dc9d07058e6fb4b3b24169f072a2 Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Sun, 21 Jan 2024 17:32:45 +0100 Subject: [PATCH] Use rpm.ds instead of deprecated hdr.dsFromHeader Fix #481 See also https://github.com/rpm-software-management/mock/pull/1223 As a reproducer, I used the following releaser: [yum] releaser = tito.release.YumRepoReleaser builder = tito.builder.Builder srpm_disttag = fc39 rsync = /tmp/tito/yum-repo and then did `tito release yum`. --- src/tito/release/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tito/release/main.py b/src/tito/release/main.py index 8010bec5..52405f24 100644 --- a/src/tito/release/main.py +++ b/src/tito/release/main.py @@ -400,7 +400,8 @@ def prune_other_versions(self, temp_dir): header = self._read_rpm_header(rpm_ts, artifact) except rpm.error: continue - self.new_rpm_dep_sets[header['name']] = header.dsOfHeader() + rpm_ds = rpm.ds(header, rpm.RPMTAG_NEVR) + self.new_rpm_dep_sets[header['name']] = rpm_ds # Now cleanout any other version of the package we just built, # both older or newer. (can be used to downgrade the contents @@ -416,7 +417,7 @@ def prune_other_versions(self, temp_dir): print("error reading rpm header in '%s': %s" % (full_path, e)) continue if hdr['name'] in self.new_rpm_dep_sets: - dep_set = hdr.dsOfHeader() + dep_set = rpm.ds(header, rpm.RPMTAG_NEVR) if dep_set.EVR() < self.new_rpm_dep_sets[hdr['name']].EVR(): print("Deleting old package: %s" % filename) run_command("rm %s" % os.path.join(temp_dir,