Pull two patches from upstream

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-01-24 16:01:31 -05:00
parent 65d208ac91
commit 4c3f5bcd5b
3 changed files with 54 additions and 2 deletions

View File

@ -0,0 +1,22 @@
From 3d046016c4ca8860485ab27dd42eaf5bc49872a7 Mon Sep 17 00:00:00 2001
From: Michael Herold <m.herold@fu-berlin.de>
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

View File

@ -0,0 +1,25 @@
From 87a9d645500c7adea0bfea34e35562fbdf176054 Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
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

View File

@ -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 <zbyszek@bupkis> - 231-4
- Bugfixes for seek_monotonic and Python 2 compat
* Sun Nov 15 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 231-3
- Split out doc subpackage (#1242619)
- Do not allow installation of python-systemd in different versions