From fd660a4dde59962cf7c055f66337ad3261d44367 Mon Sep 17 00:00:00 2001 From: Zdenek Pytela Date: Fri, 17 May 2024 22:13:06 +0200 Subject: [PATCH] Correct some errors in the RPM macro changes from -2 The commands should always end || : , because by policy we should ensure RPM scriptlets always exit 0: https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax Also, rm is in _bindir, not _sbindir. This seems to have caused a failed test for an nbdkit update: https://openqa.fedoraproject.org/tests/2628713# the live image build failed because of a scriptlet error that seems to be caused by this: INFO:anaconda.modules.payloads.payload.dnf.transaction_progress:Configuring (running scriptlet for): nbdkit-selinux-1.39.6-1.fc41.noarch 1715870254 02561380439e4e22473970fa46db331b277dc254650fdcb96130a056cadaf02f INFO:dnf.rpm:/var/tmp/rpm-tmp.ycmrWv: line 10: /usr/sbin/rm: No such file or directory warning: %post(nbdkit-selinux-1.39.6-1.fc41.noarch) scriptlet failed, exit status 1 ERROR:dnf.rpm:Error in POSTIN scriptlet in rpm package nbdkit-selinux Signed-off-by: Adam Williamson --- rpm.macros | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rpm.macros b/rpm.macros index dcab0186..6661955c 100644 --- a/rpm.macros +++ b/rpm.macros @@ -55,10 +55,10 @@ if [ -z "${_policytype}" ]; then \ _policytype="targeted" \ fi \ if [ "${SELINUXTYPE}" = "${_policytype}" ]; then \ - %{_sbindir}/rm -rf %{_sharedstatedir}/selinux/${_policytype}/active/modules/400/extra_varrun \ + %{_bindir}/rm -rf %{_sharedstatedir}/selinux/${_policytype}/active/modules/400/extra_varrun || : \ %{_sbindir}/semodule -n -s ${_policytype} -X %{!-p:200}%{-p*} -i %* || : \ %{_sbindir}/selinuxenabled && %{_sbindir}/load_policy || : \ - %{_libexecdir}/selinux/varrun-convert.sh ${_policytype} \ + %{_libexecdir}/selinux/varrun-convert.sh ${_policytype} || : \ fi \ %{nil} @@ -73,10 +73,10 @@ if [ -z "${_policytype}" ]; then \ fi \ if [ $1 -eq 0 ]; then \ if [ "${SELINUXTYPE}" = "${_policytype}" ]; then \ - %{_sbindir}/rm -rf %{_sharedstatedir}/selinux/${_policytype}/active/modules/400/extra_varrun \ + %{_bindir}/rm -rf %{_sharedstatedir}/selinux/${_policytype}/active/modules/400/extra_varrun || : \ %{_sbindir}/semodule -n -X %{!-p:200}%{-p*} -s ${_policytype} -r %* &> /dev/null || : \ %{_sbindir}/selinuxenabled && %{_sbindir}/load_policy || : \ - %{_libexecdir}/selinux/varrun-convert.sh ${_policytype} \ + %{_libexecdir}/selinux/varrun-convert.sh ${_policytype} || : \ fi \ fi \ %{nil}