Fix %postun scriptlet for llvm-devel when upgrading/downgrading

The scriptlet tried to run llvm-config-%{maj_ver} when upgrading or
downgrading to check if ${maj_ver} has changed. Since postun runs
after the package files have been uninstalled this will always fail
to run the command. We should run instead llvm-config%{exec_suffix},
which in the case of upgrades or downgrades will still be present,
installed from the new package.
This commit is contained in:
Jesus Checa Hidalgo 2024-10-21 10:00:27 +02:00
parent cbf1601ea0
commit 71b35f8e70

View file

@ -1672,7 +1672,7 @@ fi
# alternative must be removed in order to give priority to a newly installed # alternative must be removed in order to give priority to a newly installed
# compat package. # compat package.
if [[ $1 -eq 0 if [[ $1 -eq 0
|| "x$(%{_bindir}/llvm-config-%{maj_ver} --version | awk -F . '{ print $1 }')" != "x%{maj_ver}" ]]; then || "x$(%{_bindir}/llvm-config%{exec_suffix} --version | awk -F . '{ print $1 }')" != "x%{maj_ver}" ]]; then
%{_sbindir}/update-alternatives --remove llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{_sbindir}/update-alternatives --remove llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits}
fi fi
%endif %endif