Restore former alternatives symlinks, if they are missing

Fixes #2297425.
This commit is contained in:
Peter Oliver 2024-07-12 00:06:36 +01:00
commit 58ec00daa6

View file

@ -575,6 +575,11 @@ fi
%posttrans lucid
/usr/sbin/alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-lucid 70 || :
# The preun scriptlet of packages before 29.4-5 will remove this symlink
# after it has been installed, so we may need to put it back:
if [ $1 = 2 && ! -h %{_bindir}/emacs-lucid ]; then
ln -s %emacs-%{version}-nw %{_bindir}/emacs-lucid
fi
%preun gtk+x11
if [ $1 = 0 ]; then
@ -583,6 +588,11 @@ fi
%posttrans gtk+x11
/usr/sbin/alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-gtk+x11 75 || :
# The preun scriptlet of packages before 29.4-5 will remove this symlink
# after it has been installed, so we may need to put it back:
if [ $1 = 2 && ! -h %{_bindir}/emacs-gtk+x11 ]; then
ln -s %emacs-%{version}-nw %{_bindir}/emacs-gtk+x11
fi
%preun nw
if [ $1 = 0 ]; then
@ -591,6 +601,11 @@ fi
%posttrans nw
/usr/sbin/alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-nw 70 || :
# The preun scriptlet of packages before 29.4-5 will remove this symlink
# after it has been installed, so we may need to put it back:
if [ $1 = 2 && ! -h %{_bindir}/emacs-nw ]; then
ln -s %emacs-%{version}-nw %{_bindir}/emacs-nw
fi
%preun common
if [ $1 = 0 ]; then