From f287b9d310b4cd89e991a60634370df70a4997b73ae2aecdae705d755da8bfdf Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Wed, 15 May 2013 14:48:13 +0000 Subject: [PATCH] - Fix update-alternatives and support upgrade from previous versions - Fix update-alternatives and support upgrade from previous versions OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-coverage?expand=0&rev=27 --- python-coverage.changes | 5 +++++ python-coverage.spec | 16 ++++++++++++---- python3-coverage.changes | 5 +++++ python3-coverage.spec | 16 ++++++++++++---- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/python-coverage.changes b/python-coverage.changes index eba323e..2420850 100644 --- a/python-coverage.changes +++ b/python-coverage.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 15 14:50:46 UTC 2013 - speilicke@suse.com + +- Fix update-alternatives and support upgrade from previous versions + ------------------------------------------------------------------- Fri May 3 09:15:27 UTC 2013 - speilicke@suse.com diff --git a/python-coverage.spec b/python-coverage.spec index bf7cb10..8091178 100644 --- a/python-coverage.spec +++ b/python-coverage.spec @@ -51,6 +51,8 @@ python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} +rm %{buildroot}%{_bindir}/coverage +ln -s %{_bindir}/coverage-%{py_ver} %{buildroot}/%{_bindir}/coverage #NOTE(saschpe): The following seems to mess with the install dir, which is odd: #%%check @@ -61,19 +63,25 @@ python setup.py install --prefix=%{_prefix} --root=%{buildroot} #python setup.py --quiet build_ext --inplace #python igor.py test_with_tracer c +%pre +# Since /usr/bin/coverage became ghosted to be used with update-alternatives, we have +# to get rid of the old binary resulting from the non-update-alternativies-ified package: +[[ ! -L %{_bindir}/coverage ]] && rm -f %{_bindir}/coverage +exit 0 + %post update-alternatives \ - --install %{_bindir}/coverage coverage %{_bindir}/coverage-%{py_ver} 10 + --install %{_bindir}/coverage coverage %{_bindir}/coverage-%{py_ver} 20 -%postun +%preun if [ $1 -eq 0 ] ; then - update-alternatives --remove coverage %{_bindir}/coverage-%{py_ver} + update-alternatives --remove coverage %{_bindir}/coverage-%{py_ver} fi %files %defattr(-,root,root,-) %doc AUTHORS.txt CHANGES.txt README.txt -%ghost %attr(0755,root,root) %{_bindir}/coverage +%ghost %{_bindir}/coverage %{_bindir}/coverage2 %{_bindir}/coverage-%{py_ver} %{python_sitearch}/coverage/ diff --git a/python3-coverage.changes b/python3-coverage.changes index 9287573..bc3294a 100644 --- a/python3-coverage.changes +++ b/python3-coverage.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 15 14:51:01 UTC 2013 - speilicke@suse.com + +- Fix update-alternatives and support upgrade from previous versions + ------------------------------------------------------------------- Fri May 3 10:05:07 UTC 2013 - speilicke@suse.com diff --git a/python3-coverage.spec b/python3-coverage.spec index 71a50fc..6251a67 100644 --- a/python3-coverage.spec +++ b/python3-coverage.spec @@ -45,20 +45,28 @@ python3 setup.py build %install python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} +rm %{buildroot}%{_bindir}/coverage +ln -s %{_bindir}/coverage-%{py3_ver} %{buildroot}/%{_bindir}/coverage + +%pre +# Since /usr/bin/coverage became ghosted to be used with update-alternatives, we have +# to get rid of the old binary resulting from the non-update-alternativies-ified package: +[[ ! -L %{_bindir}/coverage ]] && rm -f %{_bindir}/coverage +exit 0 %post update-alternatives \ - --install %{_bindir}/coverage coverage %{_bindir}/coverage-%{py3_ver} 10 + --install %{_bindir}/coverage coverage %{_bindir}/coverage-%{py3_ver} 30 -%postun +%preun if [ $1 -eq 0 ] ; then - update-alternatives --remove coverage %{_bindir}/coverage-%{py3_ver} + update-alternatives --remove coverage %{_bindir}/coverage-%{py3_ver} fi %files %defattr(-,root,root,-) %doc AUTHORS.txt CHANGES.txt README.txt -%ghost %attr(0755,root,root) %{_bindir}/coverage +%ghost %{_bindir}/coverage %{_bindir}/coverage3 %{_bindir}/coverage-%{py3_ver} %{python3_sitearch}/coverage