Accepting request 419442 from home:TheBlackCat:branches:devel:languages:python

Fix update-alternatives implementation.

OBS-URL: https://build.opensuse.org/request/show/419442
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyflakes?expand=0&rev=32
This commit is contained in:
Todd R 2016-08-15 15:35:39 +00:00 committed by Git OBS Bridge
parent 04df7f74a0
commit 2eaee26d95
2 changed files with 9 additions and 6 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Aug 15 14:51:56 UTC 2016 - toddrme2178@gmail.com
- Fix update-alternatives implementation.
-------------------------------------------------------------------
Wed Jan 13 09:57:59 UTC 2016 - toddrme2178@gmail.com

View File

@ -30,7 +30,7 @@ BuildRequires: python-setuptools
# the pkg_resources module is required at runtime
Requires: python-setuptools
Requires(post): update-alternatives
Requires(postun): update-alternatives
Requires(preun): update-alternatives
%if 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
@ -55,16 +55,14 @@ python setup.py install --prefix=%{_prefix} --root=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
mv %{buildroot}%{_bindir}/pyflakes %{buildroot}%{_bindir}/pyflakes-%{py_ver}
ln -s -f %{_sysconfdir}/alternatives/pyflakes %{buildroot}%{_bindir}/pyflakes
# create a dummy target for /etc/alternatives/pyflakes
touch %{buildroot}%{_sysconfdir}/alternatives/pyflakes
%post
"%_sbindir/update-alternatives" \
%_sbindir/update-alternatives \
--install %{_bindir}/pyflakes pyflakes %{_bindir}/pyflakes-%{py_ver} 30
%postun
%preun
if [ $1 -eq 0 ] ; then
"%_sbindir/update-alternatives" --remove pyflakes %{_bindir}/pyflakes-%{py_ver}
%_sbindir/update-alternatives --remove pyflakes %{_bindir}/pyflakes-%{py_ver}
fi
%files