The alternative for "update-alternatives" ---> libalternatives
Hi, most of you are already familiar with the usage of update-alternatives. Update-alternatives, at its core, is a symlink management system. This system is then mostly used as means for administrators of a system to select a default application. For example, if we have vim or emacs installed, the admin can then make one accessible as an editor application. Update-alternatives manages these tasks by symbolic file links which has worked out, that it could become quite instable in older updated systems. Adam Majer has established a new concept how to handle the update-alternatives tasks: libalternatives Libalternatives does not use file links anymore but little configuration files which is much more stable and quite easy to handle by the administrator. Have a look to https://github.com/openSUSE/libalternatives for more information. One additional benefit of libalternatives is that it does not create entries in the /etc directory anymore. In the future the /etc directory will be used for entries/changes ONLY which have been done by the administrator and do not belong to packages or have been created by package installation. I have already switched about 40 packages to the new libalternatives which we need around MicroOS and have submitted it to factory. This list includes a lot of python packages. Python packages are using nice RPM macros for handling update-alternatives stuff. Currently the fixes are made manually in the spec files and it will not be done by macros anymore. I have done this step at first in order to get a feeling what is needed for using/updating these macros at first. Now I will patch the alternatives macros or will write new one in order to simplify it again. And yes, I will update the regarding python packages again. So please, do not panic :-) Please inform us if you have any comments, suggestions or even doubts. Greetings Stefan -- ******************************************************************************* Stefan Schubert e-mail: schubi@suse.de ------------------------------------------------------------------------------- SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer
Dne 20. 09. 21 v 9:19 Stefan Schubert napsal(a):
One additional benefit of libalternatives is that it does not create entries in the /etc directory anymore. In the future the /etc directory will be used for entries/changes ONLY which have been done by the administrator and do not belong to packages or have been created by package installation.
I am not sure whether this is the right way to do (linking all binaries into one shared binary? Are we missing a need for some more fundamental change? Does /usr/bin serve as well?), but yes, update-alternatives is pretty painful, so let's try something else, it couldn't be that much worse, and yes configuration via text file always beats configuration via symlinks, so let's do it.
This list includes a lot of python packages. Python packages are using nice RPM macros for handling update-alternatives stuff. Currently the fixes are made manually in the spec files and it will not be done by macros anymore.
??? Why you cannot push those %ifs (which I am not sure are correct, don't we want to have this working in SLE-15SP4 as well?) to our macros?
Now I will patch the alternatives macros or will write new one in order to simplify it again.
Looking forward to your pull request on python-rpm-macros then. Best, Matěj -- https://matej.ceplovi.cz/blog/, Jabber: mcepl@ceplovi.cz GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8 La vita è una combinazione di magia e pasta. -- Federico Fellini
Am 20.09.21 um 09:27 schrieb Matěj Cepl:
Dne 20. 09. 21 v 9:19 Stefan Schubert napsal(a):
One additional benefit of libalternatives is that it does not create entries in the /etc directory anymore. In the future the /etc directory will be used for entries/changes ONLY which have been done by the administrator and do not belong to packages or have been created by package installation.
I am not sure whether this is the right way to do (linking all binaries into one shared binary? Are we missing a need for some more fundamental change? Hm, currently I cannot see another solution for it. Any suggestions ? Does /usr/bin serve as well?), Yes, as far I have seen in the packages which I have updated.
This list includes a lot of python packages. Python packages are using nice RPM macros for handling update-alternatives stuff. Currently the fixes are made manually in the spec files and it will not be done by macros anymore.
??? Why you cannot push those %ifs (which I am not sure are correct, don't we want to have this working in SLE-15SP4 as well?) to our macros?
Now I will patch the alternatives macros or will write new one in order to simplify it again.
Looking forward to your pull request on python-rpm-macros then. Ah, I have a reviewer, thank you ! :-)
Greetings Stefan -- ******************************************************************************* Stefan Schubert e-mail: schubi@suse.de ------------------------------------------------------------------------------- SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer
participants (2)
-
Matěj Cepl
-
Stefan Schubert