From 5c76f5e53e0f7c9c00da0e0d8743a3b683e4da10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= Date: Tue, 16 Jul 2024 14:28:44 +0200 Subject: [PATCH] Use the same nevra format for history and regular transactions When serializing a history transaction package nevra use the same format that is used when serializing base transaction. It is also described in a comment: https://github.com/rpm-software-management/dnf5/blob/main/libdnf5/transaction/transaction_sr.hpp#L62 --- libdnf5/transaction/transaction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libdnf5/transaction/transaction.cpp b/libdnf5/transaction/transaction.cpp index 5dca94dd2..3a0f6f427 100644 --- a/libdnf5/transaction/transaction.cpp +++ b/libdnf5/transaction/transaction.cpp @@ -331,7 +331,8 @@ std::string Transaction::serialize() { for (const auto & pkg : get_packages()) { PackageReplay package_replay; - package_replay.nevra = pkg.to_string(); + // Use to_nevra_string in order to have nevra wihtout epoch if it is 0 + package_replay.nevra = rpm::to_nevra_string(pkg); package_replay.action = pkg.get_action(); package_replay.reason = pkg.get_reason(); package_replay.repo_id = pkg.get_repoid();