1
0
forked from pool/python-flake8

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

Fix update-alternatives implementation.

OBS-URL: https://build.opensuse.org/request/show/419446
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8?expand=0&rev=24
This commit is contained in:
Todd R 2016-08-15 15:36:52 +00:00 committed by Git OBS Bridge
parent 42dbcea85c
commit 09603db66d
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:25:06 UTC 2016 - toddrme2178@gmail.com

View File

@ -36,7 +36,7 @@ Requires: python-mccabe >= 0.2.1
Requires: python-pep8 >= 1.5.7
Requires: python-pyflakes >= 0.8.1
Requires(post): update-alternatives
Requires(postun): update-alternatives
Requires(preun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
@ -66,16 +66,14 @@ python setup.py install --prefix=%{_prefix} --root=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
mv %{buildroot}%{_bindir}/flake8 %{buildroot}%{_bindir}/flake8-%{py_ver}
ln -s -f %{_sysconfdir}/alternatives/flake8 %{buildroot}%{_bindir}/flake8
# create a dummy target for /etc/alternatives/flake8
touch %{buildroot}%{_sysconfdir}/alternatives/flake8
%post
"%_sbindir/update-alternatives" \
%_sbindir/update-alternatives \
--install %{_bindir}/flake8 flake8 %{_bindir}/flake8-%{py_ver} 30
%postun
%preun
if [ $1 -eq 0 ] ; then
"%_sbindir/update-alternatives" --remove flake8 %{_bindir}/flake8-%{py_ver}
%_sbindir/update-alternatives --remove flake8 %{_bindir}/flake8-%{py_ver}
fi
%check