From 2eaee26d95ef6688c50eb88886f2be98d9f2baa8c1c0d7597019a480a955a78c Mon Sep 17 00:00:00 2001 From: Todd R Date: Mon, 15 Aug 2016 15:35:39 +0000 Subject: [PATCH] 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 --- python-pyflakes.changes | 5 +++++ python-pyflakes.spec | 10 ++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/python-pyflakes.changes b/python-pyflakes.changes index a999efe..51f9d59 100644 --- a/python-pyflakes.changes +++ b/python-pyflakes.changes @@ -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 diff --git a/python-pyflakes.spec b/python-pyflakes.spec index 6ff793a..fdef9d7 100644 --- a/python-pyflakes.spec +++ b/python-pyflakes.spec @@ -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