Move %postInstall to %posttrans

If policy update removes a module, %postInstall and therefore policy
rebuild - `semodule -B -n ...` was run when old module is still
installed, see
https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#ordering
It resulted to state when the old module is still built in the policy
after update until another `semodule -B` is triggered.

Moving %postInstall to %posttrans should solve this problem

[skip changelog]

Related: RHEL-54303
This commit is contained in:
Petr Lautrbach 2024-07-11 22:32:41 +02:00
parent 3fed54cdcc
commit 4bb6c144e3

View File

@ -589,12 +589,12 @@ SELinux targeted policy package.
%post targeted %post targeted
%checkConfigConsistency targeted %checkConfigConsistency targeted
%postInstall $1 targeted
exit 0 exit 0
%posttrans targeted %posttrans targeted
%checkConfigConsistency targeted %checkConfigConsistency targeted
%{_libexecdir}/selinux/varrun-convert.sh targeted %{_libexecdir}/selinux/varrun-convert.sh targeted
%postInstall $1 targeted
%{_sbindir}/restorecon -Ri /usr/lib/sysimage/rpm /var/lib/rpm %{_sbindir}/restorecon -Ri /usr/lib/sysimage/rpm /var/lib/rpm
%postun targeted %postun targeted
@ -795,12 +795,12 @@ SELinux MLS (Multi Level Security) policy package.
%post mls %post mls
%checkConfigConsistency mls %checkConfigConsistency mls
%postInstall $1 mls
exit 0 exit 0
%posttrans mls %posttrans mls
%checkConfigConsistency mls %checkConfigConsistency mls
%{_libexecdir}/selinux/varrun-convert.sh mls %{_libexecdir}/selinux/varrun-convert.sh mls
%postInstall $1 mls
%{_sbindir}/restorecon -Ri /usr/lib/sysimage/rpm /var/lib/rpm %{_sbindir}/restorecon -Ri /usr/lib/sysimage/rpm /var/lib/rpm
%postun mls %postun mls