refactoring alternatives

Frantisek Kluknavsky fkluknav at redhat.com
Tue Jan 27 15:25:58 UTC 2015


Hi,

I have a packaging question. Package gnuplot contained binary 
/usr/bin/gnuplot-wx. Subpackage gnuplot-qt contained binary 
/usr/bin/gnuplot-qt with roughly the same functionality using different 
GUI. Now it is time to declare qt default and wxGTK obsolete. 
/usr/bin/gnuplot-qt should be in default package gnuplot, 
/usr/bin/gnuplot-wx in subpackage gnuplot-wx.

My question is about alternatives. Both packages do something like 
http://fedoraproject.org/wiki/Packaging:Alternatives suggests:
%preun
if [ $1 = 0 ]; then
     %{_sbindir}/alternatives --remove gnuplot %{_bindir}/gnuplot-wx || :
fi
Now the name of the binary in package 'gnuplot' changes during an 
update. But the package is not removed and the %preun scriptlet thinks 
that old alternative should be left untouched.

What is the correct way to do this? My best idea so far is to increase 
priority of new alternative. Old alternative will remain rotting but a 
regular unknowing user will not notice broken symlinks after update.

Thank you very much and have a nice day.

Fero


More information about the devel mailing list