Fix upgrade to not remove keylime-agent-rust

Remove the Obsoletes from keylime-agent-rust-common subpackage to avoid
removing the keylime-agent-rust package in an upgrade scenario.

Add conflicts to the keylime-agent-rust-common and
keylime-agent-rust-ima-emulator to make the dnf transaction to remove
them when downgrading to a version prior to the package split.

Remove the agent.conf from the main package since it is already included
in the keylime-agent-rust-common subpackage, preventing a file conflict.

Resolves: RHEL-170004

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
This commit is contained in:
Anderson Toshiyuki Sasaki 2026-04-22 17:38:19 +02:00
parent ed1481b518
commit 71657f97c8
No known key found for this signature in database

View File

@ -106,9 +106,10 @@ Summary: Common files for Keylime agent
License: (Apache-2.0 OR MIT) AND BSD-3-Clause AND (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR MIT) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 OR MIT OR Zlib) AND Apache-2.0 WITH LLVM-exception AND ISC AND MIT AND (MIT OR Unlicense)
BuildArch: noarch
# This is necessary to provide a clean upgrade path from the previous
# keylime-agent-rust which shipped the IMA emulator
Obsoletes: keylime-agent-rust < %{version}-%{release}
# The old unsplit keylime-agent-rust shipped files now owned by -common
# (agent.conf, config dirs). This conflict ensures the split packages are
# removed on downgrade to avoid file conflicts.
Conflicts: keylime-agent-rust < 0.2.9
%description common
Common files for the Keylime agent in both push and pull models
@ -154,6 +155,11 @@ Requires: keylime-agent-rust-common = %{version}-%{release}
Requires: keylime-base
%endif
# The old unsplit keylime-agent-rust shipped keylime_ima_emulator binary.
# This conflict ensures the split packages are removed on downgrade to avoid
# file conflicts.
Conflicts: keylime-agent-rust < 0.2.9
Provides: keylime-ima-emulator = %{version}-%{release}
%description ima-emulator
@ -251,7 +257,6 @@ chown -R keylime:keylime %{_sysconfdir}/keylime
%if 0%{?bundled_rust_deps}
%license cargo-vendor.txt
%endif
%config(noreplace) %attr(400,keylime,keylime) %{_sysconfdir}/keylime/agent.conf
%{_unitdir}/keylime_agent.service
%{_unitdir}/var-lib-keylime-secure.mount
%{_bindir}/keylime_agent