12.08.2016 01:54, Greg Freemyer пишет:
On Thu, Aug 11, 2016 at 6:09 PM, Greg Freemyer
wrote: On Thu, Aug 11, 2016 at 11:37 AM, Dominique Leuenberger / DimStar I'm totally new to alternatives, but ...
In the install section of the wiki page I see:
===== %install # create a dummy target for /etc/alternatives/vim mkdir -p %{buildroot}%{_sysconfdir}/alternatives ln -s -f %{_sysconfdir}/alternatives/vim %{buildroot}%{_bindir}/vim =====
Isn't that missing %{buildroot} in the first arg of the link statement?
No. It is target of symlink as it will appear on installed system.
If not, what does the mkdir line have it?
One step is missing in example - creating (empty) file for %ghost to work - %{buildroot}%{_sysconfdir}/alternatives/vim. This should obviously happen under buildroot.
If correct as is, it seems a comment is appropriate.
Greg
Another question about the wiki example:
=== %postun if [ "$1" = 0 ] ; then update-alternatives --remove vim %{_bindir}/vim-normal fi
%preun enhanced if [ "$1" = 0 ] ; then update-alternatives --remove vim %{_bindir}/vim-enhanced fi ===
Shouldn't they both be postun or preun?
No. As a general rule you cleanup package *before* you remove it. In particular, running in %postun all files are already removed, I'm not sure what update-alternatives does in this case.
If not, a comment in the example as to why the choice would be good.
What I am unsure - I was under impression that link target is managed by update-alternatives too, i.e. in this case /usr/bin/vim is created by update-alternatives --install. In this case it probably has to be %ghost as well. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org