Skip to content

Commit

Permalink
Use rpm.ds instead of deprecated hdr.dsFromHeader
Browse files Browse the repository at this point in the history
Fix #481
See also rpm-software-management/mock#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`.
  • Loading branch information
FrostyX committed Jan 21, 2024
1 parent 3cb798f commit d6980fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tito/release/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit d6980fd

Please sign in to comment.