From 4c3f5bcd5bdc82c4ee6040c741834f390d2bc25f Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Jan 24 2016 21:01:31 +0000 Subject: Pull two patches from upstream --- diff --git a/3d046016c4ca8860485ab27dd42eaf5bc49872a7.patch b/3d046016c4ca8860485ab27dd42eaf5bc49872a7.patch new file mode 100644 index 0000000..8acf866 --- /dev/null +++ b/3d046016c4ca8860485ab27dd42eaf5bc49872a7.patch @@ -0,0 +1,22 @@ +From 3d046016c4ca8860485ab27dd42eaf5bc49872a7 Mon Sep 17 00:00:00 2001 +From: Michael Herold +Date: Thu, 10 Dec 2015 00:18:01 +0100 +Subject: [PATCH] Fixes Reader.seek_monotonic(datetime.timedelta) + +--- + systemd/journal.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/systemd/journal.py b/systemd/journal.py +index b319a8a..fae7f6f 100644 +--- a/systemd/journal.py ++++ b/systemd/journal.py +@@ -291,7 +291,7 @@ def seek_monotonic(self, monotonic, bootid=None): + is reference to. Defaults to current bootid. + """ + if isinstance(monotonic, _datetime.timedelta): +- monotonic = monotonic.totalseconds() ++ monotonic = monotonic.total_seconds() + monotonic = int(monotonic * 1000000) + if isinstance(bootid, _uuid.UUID): + bootid = bootid.hex diff --git a/87a9d645500c7adea0bfea34e35562fbdf176054.patch b/87a9d645500c7adea0bfea34e35562fbdf176054.patch new file mode 100644 index 0000000..eee9a78 --- /dev/null +++ b/87a9d645500c7adea0bfea34e35562fbdf176054.patch @@ -0,0 +1,25 @@ +From 87a9d645500c7adea0bfea34e35562fbdf176054 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Sat, 19 Dec 2015 09:42:49 -0500 +Subject: [PATCH] test_daemon: Define a default value for SO_PASSCRED + +The socket module seems to be missing this in python2.7. +--- + systemd/test/test_daemon.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/systemd/test/test_daemon.py b/systemd/test/test_daemon.py +index e055048..8c776d5 100644 +--- a/systemd/test/test_daemon.py ++++ b/systemd/test/test_daemon.py +@@ -228,7 +228,9 @@ def test_notify_with_socket(tmpdir): + path = tmpdir.join('socket').strpath + sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) + sock.bind(path) +- sock.setsockopt(socket.SOL_SOCKET, socket.SO_PASSCRED, 1) ++ # SO_PASSCRED is not defined in python2.7 ++ SO_PASSCRED = getattr(socket, 'SO_PASSCRED', 16) ++ sock.setsockopt(socket.SOL_SOCKET, SO_PASSCRED, 1) + os.environ['NOTIFY_SOCKET'] = path + + assert notify('READY=1') == True diff --git a/python-systemd.spec b/python-systemd.spec index 234d7ea..7706d45 100644 --- a/python-systemd.spec +++ b/python-systemd.spec @@ -1,11 +1,13 @@ Name: python-systemd Version: 231 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Python module wrapping systemd functionality License: LGPLv2+ URL: https://github.com/systemd/python-systemd Source0: https://github.com/systemd/python-systemd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Patch0: https://github.com/systemd/python-systemd/commit/3d046016c4ca8860485ab27dd42eaf5bc49872a7.patch +Patch1: https://github.com/systemd/python-systemd/commit/87a9d645500c7adea0bfea34e35562fbdf176054.patch BuildRequires: systemd-devel BuildRequires: python2-devel @@ -70,7 +72,7 @@ Requires: js-jquery %{summary}. %prep -%autosetup +%autosetup -p1 %build make PYTHON=%{__python2} build @@ -109,6 +111,9 @@ make PYTHON=%{__python3} check || : %doc %{_pkgdocdir}/html %changelog +* Sun Jan 24 2016 Zbigniew Jędrzejewski-Szmek - 231-4 +- Bugfixes for seek_monotonic and Python 2 compat + * Sun Nov 15 2015 Zbigniew Jędrzejewski-Szmek - 231-3 - Split out doc subpackage (#1242619) - Do not allow installation of python-systemd in different versions