a37b5b5bde8c added %preun scriptlets that use ${_sbindir}, which is
shell syntax rather than an rpm macro, so it expands to empty at run
time and the scriptlet runs "/update-alternatives", failing on
uninstall/upgrade with:
/var/tmp/rpm-tmp.K1fvm3: line 2: /update-alternatives: No such file or directory
error: %preun(ceph-osd-crimson-2:20.3.0-5054.g33c1d671.el9.x86_64) scriptlet failed, exit status 127
Error in PREUN scriptlet in rpm package ceph-osd-crimson.
use %{_sbindir}, like the %posttrans --install lines already do, so it
expands to /usr/sbin/update-alternatives at build time.
Fixes: https://tracker.ceph.com/issues/77323
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
%preun osd-crimson
if [ $1 -eq 0 ]; then
- ${_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-osd-crimson
+ %{_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-osd-crimson
fi
%endif
%preun osd-classic
if [ $1 -eq 0 ]; then
- ${_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-osd-classic
+ %{_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-osd-classic
fi
%files volume