Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use rpm.ds instead of deprecated hdr.dsFromHeader #488

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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