From 79e52652ce376160fd269a6ede8f762373309142b62d79d547b514131ea532e2 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 17 Sep 2021 20:53:35 +0000 Subject: [PATCH 1/5] Accepting request 919792 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/919792 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpatch?expand=0&rev=47 --- python-jsonpatch.changes | 5 +++++ python-jsonpatch.spec | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/python-jsonpatch.changes b/python-jsonpatch.changes index 62793f0..5a6adac 100644 --- a/python-jsonpatch.changes +++ b/python-jsonpatch.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Aug 22 20:36:59 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Tue May 18 21:54:01 UTC 2021 - Dirk Müller diff --git a/python-jsonpatch.spec b/python-jsonpatch.spec index 7f5eea3..1f5dbea 100644 --- a/python-jsonpatch.spec +++ b/python-jsonpatch.spec @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-jsonpatch Version: 1.32 @@ -30,8 +36,12 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-jsonpointer >= 1.9 +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(preun):update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -48,23 +58,47 @@ Python module to apply JSON-Patches (according to RFC 6902). %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} -# Prepare for update-alternatives usage -%python_clone -a %{buildroot}%{_bindir}/jsonpatch +%if ! %{with libalternatives} + # Prepare for update-alternatives usage + %python_clone -a %{buildroot}%{_bindir}/jsonpatch +%else + %python_clone %{buildroot}%{_bindir}/jsonpatch + ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/jsonpatch + mkdir -p %{buildroot}%{_datadir}/libalternatives/jsonpatch + %python_expand echo "binary=%{_bindir}/jsonpatch-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/jsonpatch/10%{$python_version_nodots}.conf +%endif + rm %{buildroot}%{_bindir}/jsondiff %check %python_exec tests.py +%if %{with libalternatives} +%pre +# removing old update-alternatives entries +if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then + %python_uninstall_alternative jsonpatch +fi +%else %post %python_install_alternative jsonpatch %preun %python_uninstall_alternative jsonpatch +%endif %files %{python_files} %license COPYING %doc AUTHORS README.md +%if ! 0%{with libalternatives} %python_alternative %{_bindir}/jsonpatch +%else +%dir %{_datadir}/libalternatives +%dir %{_datadir}/libalternatives/jsonpatch +%{_datadir}/libalternatives/jsonpatch/10%python_version_nodots.conf +%{_bindir}/jsonpatch +%{_bindir}/jsonpatch-%python_version +%endif %{python_sitelib}/* %changelog From aa361305812f9bfd0cc29073926c28c1ddcd22492e4c45fcd11eb95b6ecdf45d Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 17 Sep 2021 21:02:36 +0000 Subject: [PATCH 2/5] - Don't use python setup.py test expression. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpatch?expand=0&rev=48 --- python-jsonpatch.changes | 5 +++++ python-jsonpatch.spec | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/python-jsonpatch.changes b/python-jsonpatch.changes index 5a6adac..6a4d62f 100644 --- a/python-jsonpatch.changes +++ b/python-jsonpatch.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Sep 17 21:02:26 UTC 2021 - Matej Cepl + +- Don't use python setup.py test expression. + ------------------------------------------------------------------- Sun Aug 22 20:36:59 UTC 2021 - Stefan Schubert diff --git a/python-jsonpatch.spec b/python-jsonpatch.spec index 1f5dbea..4cccc78 100644 --- a/python-jsonpatch.spec +++ b/python-jsonpatch.spec @@ -71,15 +71,16 @@ Python module to apply JSON-Patches (according to RFC 6902). rm %{buildroot}%{_bindir}/jsondiff %check -%python_exec tests.py +%pyunittest -v tests %if %{with libalternatives} %pre # removing old update-alternatives entries if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then %python_uninstall_alternative jsonpatch -fi +fi %else + %post %python_install_alternative jsonpatch @@ -99,6 +100,6 @@ fi %{_bindir}/jsonpatch %{_bindir}/jsonpatch-%python_version %endif -%{python_sitelib}/* +%{python_sitelib}/jsonpatch* %changelog From 538756161a643c81a5935fdd409be4902167d1e43502672d9e7500ad2592cd40 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 19 Sep 2021 17:28:31 +0000 Subject: [PATCH 3/5] Accepting request 920170 from devel:languages:python revert OBS-URL: https://build.opensuse.org/request/show/920170 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpatch?expand=0&rev=49 --- python-jsonpatch.changes | 10 ---------- python-jsonpatch.spec | 43 ++++------------------------------------ 2 files changed, 4 insertions(+), 49 deletions(-) diff --git a/python-jsonpatch.changes b/python-jsonpatch.changes index 6a4d62f..62793f0 100644 --- a/python-jsonpatch.changes +++ b/python-jsonpatch.changes @@ -1,13 +1,3 @@ -------------------------------------------------------------------- -Fri Sep 17 21:02:26 UTC 2021 - Matej Cepl - -- Don't use python setup.py test expression. - -------------------------------------------------------------------- -Sun Aug 22 20:36:59 UTC 2021 - Stefan Schubert - -- Use libalternatives instead of update-alternatives. - ------------------------------------------------------------------- Tue May 18 21:54:01 UTC 2021 - Dirk Müller diff --git a/python-jsonpatch.spec b/python-jsonpatch.spec index 4cccc78..7f5eea3 100644 --- a/python-jsonpatch.spec +++ b/python-jsonpatch.spec @@ -16,12 +16,6 @@ # -%if 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-jsonpatch Version: 1.32 @@ -36,12 +30,8 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-jsonpointer >= 1.9 -%if %{with libalternatives} -Requires: alts -%else Requires(post): update-alternatives Requires(preun):update-alternatives -%endif BuildArch: noarch %python_subpackages @@ -58,48 +48,23 @@ Python module to apply JSON-Patches (according to RFC 6902). %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} -%if ! %{with libalternatives} - # Prepare for update-alternatives usage - %python_clone -a %{buildroot}%{_bindir}/jsonpatch -%else - %python_clone %{buildroot}%{_bindir}/jsonpatch - ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/jsonpatch - mkdir -p %{buildroot}%{_datadir}/libalternatives/jsonpatch - %python_expand echo "binary=%{_bindir}/jsonpatch-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/jsonpatch/10%{$python_version_nodots}.conf -%endif - +# Prepare for update-alternatives usage +%python_clone -a %{buildroot}%{_bindir}/jsonpatch rm %{buildroot}%{_bindir}/jsondiff %check -%pyunittest -v tests - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - %python_uninstall_alternative jsonpatch -fi -%else +%python_exec tests.py %post %python_install_alternative jsonpatch %preun %python_uninstall_alternative jsonpatch -%endif %files %{python_files} %license COPYING %doc AUTHORS README.md -%if ! 0%{with libalternatives} %python_alternative %{_bindir}/jsonpatch -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/jsonpatch -%{_datadir}/libalternatives/jsonpatch/10%python_version_nodots.conf -%{_bindir}/jsonpatch -%{_bindir}/jsonpatch-%python_version -%endif -%{python_sitelib}/jsonpatch* +%{python_sitelib}/* %changelog From 4fb4c9fcf7bda441ad1cc691c5efb176f4182476b5b05768cf3c908c55b1580b Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 19 Sep 2021 17:30:43 +0000 Subject: [PATCH 4/5] - Don't use python setup.py test expression. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpatch?expand=0&rev=50 --- python-jsonpatch.changes | 5 +++++ python-jsonpatch.spec | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python-jsonpatch.changes b/python-jsonpatch.changes index 62793f0..70dec2b 100644 --- a/python-jsonpatch.changes +++ b/python-jsonpatch.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Sep 17 21:02:26 UTC 2021 - Matej Cepl + +- Don't use python setup.py test expression. + ------------------------------------------------------------------- Tue May 18 21:54:01 UTC 2021 - Dirk Müller diff --git a/python-jsonpatch.spec b/python-jsonpatch.spec index 7f5eea3..8c88859 100644 --- a/python-jsonpatch.spec +++ b/python-jsonpatch.spec @@ -53,7 +53,7 @@ Python module to apply JSON-Patches (according to RFC 6902). rm %{buildroot}%{_bindir}/jsondiff %check -%python_exec tests.py +%pyunittest -v tests %post %python_install_alternative jsonpatch @@ -65,6 +65,6 @@ rm %{buildroot}%{_bindir}/jsondiff %license COPYING %doc AUTHORS README.md %python_alternative %{_bindir}/jsonpatch -%{python_sitelib}/* +%{python_sitelib}/jsonpatch* %changelog From f5f4323a3351c318d26fc9b2e736328d6b1b4137eddb0278c9c022aa4b9505b7 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 19 Sep 2021 19:45:23 +0000 Subject: [PATCH 5/5] Fix SPEC OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpatch?expand=0&rev=51 --- python-jsonpatch.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python-jsonpatch.spec b/python-jsonpatch.spec index 8c88859..78d4753 100644 --- a/python-jsonpatch.spec +++ b/python-jsonpatch.spec @@ -58,7 +58,7 @@ rm %{buildroot}%{_bindir}/jsondiff %post %python_install_alternative jsonpatch -%preun +%postun %python_uninstall_alternative jsonpatch %files %{python_files} @@ -66,5 +66,6 @@ rm %{buildroot}%{_bindir}/jsondiff %doc AUTHORS README.md %python_alternative %{_bindir}/jsonpatch %{python_sitelib}/jsonpatch* +%pycache_only %{python_sitelib}/__pycache__/jsonpatch*.pyc %changelog