From d8dcd56a76c6c489a5670a53d37f67015cff1f0235fc36b503f942880d0cf08d Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 17 Aug 2022 06:13:50 +0000 Subject: [PATCH] - Update to version 235: * Adapt the rename of systemd-activate to systemd-socket-activate performed in systemd 230. * Support for sd_listen_fds_with_names added in systemd 227. * Support for sd_journal_get_cutoff_realtime_usec added in systemd 186. * Make the Reader PY_SSIZE_T_CLEAN for py3.10 compatibility. * id128: update for systemd-243 compatibility and other fixes. * C syntax modernization. A minimum of C99 is assumed. * Fix seek_realtime to work with timezone aware date on Python 3. * journal: add namespace support. * Fixes for memory leaks and documentation. * Support for Python 2 will be removed after this release. - Remove upstreamed 0002-reader-make-PY_SSIZE_T_CLEAN.patch. - Skip two failing tests (gh#systemd/python-systemd#118) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-systemd?expand=0&rev=23 --- 0002-reader-make-PY_SSIZE_T_CLEAN.patch | 44 ------------------------- iso-c-90.patch | 15 +++++---- python-systemd-234.tar.gz | 3 -- python-systemd-235.tar.gz | 3 ++ python-systemd.changes | 19 +++++++++++ python-systemd.spec | 10 +++--- 6 files changed, 35 insertions(+), 59 deletions(-) delete mode 100644 0002-reader-make-PY_SSIZE_T_CLEAN.patch delete mode 100644 python-systemd-234.tar.gz create mode 100644 python-systemd-235.tar.gz diff --git a/0002-reader-make-PY_SSIZE_T_CLEAN.patch b/0002-reader-make-PY_SSIZE_T_CLEAN.patch deleted file mode 100644 index cbd26d6..0000000 --- a/0002-reader-make-PY_SSIZE_T_CLEAN.patch +++ /dev/null @@ -1,44 +0,0 @@ -From ab9f2797127b374665c37c06b02121f5dcf7d61c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= -Date: Thu, 12 Nov 2020 16:55:56 +0100 -Subject: [PATCH 2/2] reader: make PY_SSIZE_T_CLEAN - ---- - systemd/_reader.c | 15 +++++++++++++-- - 1 file changed, 13 insertions(+), 2 deletions(-) - ---- a/systemd/_reader.c -+++ b/systemd/_reader.c -@@ -18,7 +18,12 @@ - along with python-systemd; If not, see . - ***/ - -+#define PY_SSIZE_T_CLEAN -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wredundant-decls" - #include -+#pragma GCC diagnostic pop -+ - #include - #include - #include -@@ -707,11 +712,17 @@ PyDoc_STRVAR(Reader_add_match__doc__, - "Match is a string of the form \"FIELD=value\"."); - static PyObject* Reader_add_match(Reader *self, PyObject *args, PyObject *keywds) { - char *match; -- int match_len, r; -+ Py_ssize_t match_len; -+ int r; - if (!PyArg_ParseTuple(args, "s#:add_match", &match, &match_len)) - return NULL; - -- r = sd_journal_add_match(self->j, match, match_len); -+ if (match_len > INT_MAX) { -+ set_error(-ENOBUFS, NULL, NULL); -+ return NULL; -+ } -+ -+ r = sd_journal_add_match(self->j, match, (int) match_len); - if (set_error(r, NULL, "Invalid match") < 0) - return NULL; - diff --git a/iso-c-90.patch b/iso-c-90.patch index 5703ac4..1e096c2 100644 --- a/iso-c-90.patch +++ b/iso-c-90.patch @@ -1,17 +1,20 @@ -diff -ur python-systemd-234.orig/systemd/_daemon.c python-systemd-234/systemd/_daemon.c ---- python-systemd-234.orig/systemd/_daemon.c 2017-03-26 03:33:59.000000000 +0200 -+++ python-systemd-234/systemd/_daemon.c 2017-11-06 19:11:48.546733677 +0100 -@@ -127,11 +127,12 @@ +--- + systemd/_daemon.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/systemd/_daemon.c ++++ b/systemd/_daemon.c +@@ -121,11 +121,12 @@ static PyObject* notify(PyObject *self, return NULL; for (i = 0; i < len; i++) { + long value; - PyObject *item = PySequence_GetItem(fds, i); + _cleanup_Py_DECREF_ PyObject *item = PySequence_GetItem(fds, i); if (!item) return NULL; - long value = PyLong_AsLong(item); -+ value = PyLong_AsLong(item); ++ value = PyLong_AsLong(item); if (PyErr_Occurred()) return NULL; diff --git a/python-systemd-234.tar.gz b/python-systemd-234.tar.gz deleted file mode 100644 index 86574d3..0000000 --- a/python-systemd-234.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1037e6a92762be500a40e97bade0e2f2306e00a31a39361c5dbe99ab50eb3b93 -size 53900 diff --git a/python-systemd-235.tar.gz b/python-systemd-235.tar.gz new file mode 100644 index 0000000..a7f050e --- /dev/null +++ b/python-systemd-235.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38181dbd451fd418d316a92a34bc2118967930684cdd62c3e979fe8c8ebacffa +size 59858 diff --git a/python-systemd.changes b/python-systemd.changes index d0d5d5e..5282bdb 100644 --- a/python-systemd.changes +++ b/python-systemd.changes @@ -1,3 +1,22 @@ +------------------------------------------------------------------- +Wed Aug 17 05:49:41 UTC 2022 - Matej Cepl + +- Update to version 235: + * Adapt the rename of systemd-activate to + systemd-socket-activate performed in systemd 230. + * Support for sd_listen_fds_with_names added in systemd 227. + * Support for sd_journal_get_cutoff_realtime_usec added in + systemd 186. + * Make the Reader PY_SSIZE_T_CLEAN for py3.10 compatibility. + * id128: update for systemd-243 compatibility and other fixes. + * C syntax modernization. A minimum of C99 is assumed. + * Fix seek_realtime to work with timezone aware date on Python 3. + * journal: add namespace support. + * Fixes for memory leaks and documentation. + * Support for Python 2 will be removed after this release. +- Remove upstreamed 0002-reader-make-PY_SSIZE_T_CLEAN.patch. +- Skip two failing tests (gh#systemd/python-systemd#118) + ------------------------------------------------------------------- Sun Jul 3 21:14:35 UTC 2022 - Matej Cepl diff --git a/python-systemd.spec b/python-systemd.spec index 877b699..98f7d55 100644 --- a/python-systemd.spec +++ b/python-systemd.spec @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-systemd -Version: 234 +Version: 235 Release: 0 Summary: Python wrappers for systemd functionality License: LGPL-2.1-or-later @@ -27,10 +27,6 @@ URL: https://github.com/systemd/python-systemd Source: https://github.com/systemd/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz # PATCH-FIX-OPENSUSE iso-c-90.patch makes the building iso-c-90 compatible to allow building on SLE12 SP3 Patch1: iso-c-90.patch -# PATCH-FIX-UPSTREAM 0002-reader-make-PY_SSIZE_T_CLEAN.patch gh#systemd/python-systemd#107 mcepl@suse.com -# Originally from gh#systemd/python-systemd/commit/c71bbac357f0 -# make PY_SSIZE_T_CLEAN -Patch2: 0002-reader-make-PY_SSIZE_T_CLEAN.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -62,7 +58,9 @@ Python module for native access to the systemd facilities. Functionality is sepe %python_expand %fdupes %{buildroot}%{$python_sitearch} %check -export PYTEST_ADDOPTS="-k 'not test_reader_this_machine'" +# Not sure about the first exclusion, +# the following ones are gh#systemd/python-systemd#118 +export PYTEST_ADDOPTS="-k 'not (test_reader_this_machine or test_get_machine or test_get_machine_app_specific)'" %python_expand make PYTHON=python%{$python_version} check %files %{python_files}