mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-07-24 20:48:31 -07:00
dev-python/python-systemd: bump to 233
Package-Manager: portage-2.3.2
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
From a129428dcd92095dc5f3c7ac4b4f096181129063 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
|
||||
--
|
||||
2.6.4
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
From 177ac6d894e362b0d22a2765db280abed71cc07f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Thu, 22 Sep 2016 07:46:59 -0400
|
||||
Subject: [PATCH 1/6] tests: skip fdstore tests if not implemented
|
||||
|
||||
Should fix #12.
|
||||
---
|
||||
systemd/test/test_daemon.py | 18 +++++++++++++++---
|
||||
1 file changed, 15 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/systemd/test/test_daemon.py b/systemd/test/test_daemon.py
|
||||
index 215f1f8..e827e1d 100644
|
||||
--- a/systemd/test/test_daemon.py
|
||||
+++ b/systemd/test/test_daemon.py
|
||||
@@ -16,6 +16,15 @@ from systemd.daemon import (booted,
|
||||
import pytest
|
||||
|
||||
@contextlib.contextmanager
|
||||
+def skip_enosys():
|
||||
+ try:
|
||||
+ yield
|
||||
+ except OSError as e:
|
||||
+ if e.errno == errno.ENOSYS:
|
||||
+ pytest.skip()
|
||||
+ raise
|
||||
+
|
||||
+@contextlib.contextmanager
|
||||
def closing_socketpair(family):
|
||||
pair = socket.socketpair(family)
|
||||
try:
|
||||
@@ -200,7 +209,8 @@ def test_listen_fds_default_unset():
|
||||
|
||||
def test_notify_no_socket():
|
||||
assert notify('READY=1') == False
|
||||
- assert notify('FDSTORE=1', fds=[]) == False
|
||||
+ with skip_enosys():
|
||||
+ assert notify('FDSTORE=1', fds=[]) == False
|
||||
assert notify('FDSTORE=1', fds=[1,2]) == False
|
||||
assert notify('FDSTORE=1', pid=os.getpid()) == False
|
||||
assert notify('FDSTORE=1', pid=os.getpid(), fds=(1,)) == False
|
||||
@@ -216,7 +226,8 @@ def test_notify_bad_socket():
|
||||
with pytest.raises(connection_error):
|
||||
notify('READY=1')
|
||||
with pytest.raises(connection_error):
|
||||
- notify('FDSTORE=1', fds=[])
|
||||
+ with skip_enosys():
|
||||
+ notify('FDSTORE=1', fds=[])
|
||||
with pytest.raises(connection_error):
|
||||
notify('FDSTORE=1', fds=[1,2])
|
||||
with pytest.raises(connection_error):
|
||||
@@ -234,7 +245,8 @@ def test_notify_with_socket(tmpdir):
|
||||
os.environ['NOTIFY_SOCKET'] = path
|
||||
|
||||
assert notify('READY=1') == True
|
||||
- assert notify('FDSTORE=1', fds=[]) == True
|
||||
+ with skip_enosys():
|
||||
+ assert notify('FDSTORE=1', fds=[]) == True
|
||||
assert notify('FDSTORE=1', fds=[1,2]) == True
|
||||
assert notify('FDSTORE=1', pid=os.getpid()) == True
|
||||
assert notify('FDSTORE=1', pid=os.getpid(), fds=(1,)) == True
|
||||
--
|
||||
2.10.0
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
From b9767792b97fe56b37bb59ee3d207ae359f1651c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Thu, 22 Sep 2016 09:52:58 -0400
|
||||
Subject: [PATCH 2/6] docs: fix sphinx format warning
|
||||
|
||||
build/lib.linux-x86_64-3.5/systemd/journal.py:docstring of systemd.journal.stream:15: WARNING: Literal block expected; none found.
|
||||
---
|
||||
systemd/journal.py | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/systemd/journal.py b/systemd/journal.py
|
||||
index e930164..a74d62f 100644
|
||||
--- a/systemd/journal.py
|
||||
+++ b/systemd/journal.py
|
||||
@@ -461,9 +461,9 @@ def stream(identifier, priority=LOG_DEBUG, level_prefix=False):
|
||||
|
||||
will produce the following message in the journal::
|
||||
|
||||
- PRIORITY=7
|
||||
- SYSLOG_IDENTIFIER=myapp
|
||||
- MESSAGE=message...
|
||||
+ PRIORITY=7
|
||||
+ SYSLOG_IDENTIFIER=myapp
|
||||
+ MESSAGE=message...
|
||||
|
||||
Using the interface with print might be more convenient:
|
||||
|
||||
--
|
||||
2.10.0
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
From c3c412f90e481b88ca897e8542ced207c445c757 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Thu, 22 Sep 2016 09:59:04 -0400
|
||||
Subject: [PATCH 3/6] build-sys: add doc-sync target
|
||||
|
||||
---
|
||||
Makefile | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index df0555c..23b452e 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -53,7 +53,11 @@ sphinx-%: build
|
||||
check: build
|
||||
(cd $(builddir) && $(PYTHON) -m py.test . ../../docs $(TESTFLAGS))
|
||||
|
||||
+www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/python-systemd
|
||||
+doc-sync:
|
||||
+ rsync -rlv --delete --omit-dir-times build/html/ $(www_target)/
|
||||
+
|
||||
TAGS: $(shell git ls-files systemd/*.[ch])
|
||||
$(ETAGS) $+
|
||||
|
||||
-.PHONY: build install dist clean distclean TAGS
|
||||
+.PHONY: build install dist clean distclean TAGS doc-sync
|
||||
--
|
||||
2.10.0
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
From 35a5b281adea321ea3f7b7d688a994e735366fb0 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Thu, 22 Sep 2016 20:12:15 -0400
|
||||
Subject: [PATCH 4/6] tests: add workaround for pre-232 system returning EINVAL
|
||||
on some flags
|
||||
|
||||
---
|
||||
systemd/test/test_journal.py | 20 +++++++++++++++-----
|
||||
1 file changed, 15 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/systemd/test/test_journal.py b/systemd/test/test_journal.py
|
||||
index 0902183..dceec3f 100644
|
||||
--- a/systemd/test/test_journal.py
|
||||
+++ b/systemd/test/test_journal.py
|
||||
@@ -21,6 +21,13 @@ def skip_enosys():
|
||||
pytest.skip()
|
||||
raise
|
||||
|
||||
+@contextlib.contextmanager
|
||||
+def skip_valueerror():
|
||||
+ try:
|
||||
+ yield
|
||||
+ except ValueError:
|
||||
+ pytest.skip()
|
||||
+
|
||||
def test_priorities():
|
||||
p = journal.JournalHandler.mapPriority
|
||||
|
||||
@@ -62,10 +69,12 @@ def test_reader_init_flags():
|
||||
def test_reader_os_root(tmpdir):
|
||||
with pytest.raises(ValueError):
|
||||
journal.Reader(journal.OS_ROOT)
|
||||
- j1 = journal.Reader(path=tmpdir.strpath,
|
||||
- flags=journal.OS_ROOT)
|
||||
- j2 = journal.Reader(path=tmpdir.strpath,
|
||||
- flags=journal.OS_ROOT | journal.CURRENT_USER)
|
||||
+ with skip_valueerror():
|
||||
+ j1 = journal.Reader(path=tmpdir.strpath,
|
||||
+ flags=journal.OS_ROOT)
|
||||
+ with skip_valueerror():
|
||||
+ j2 = journal.Reader(path=tmpdir.strpath,
|
||||
+ flags=journal.OS_ROOT | journal.CURRENT_USER)
|
||||
j3 = journal.Reader(path=tmpdir.strpath,
|
||||
flags=journal.OS_ROOT | journal.SYSTEM_ONLY)
|
||||
|
||||
@@ -91,7 +100,8 @@ def test_reader_init_path_fd(tmpdir):
|
||||
j1 = journal.Reader(path=fd)
|
||||
assert list(j1) == []
|
||||
|
||||
- j2 = journal.Reader(journal.SYSTEM, path=fd)
|
||||
+ with skip_valueerror():
|
||||
+ j2 = journal.Reader(journal.SYSTEM, path=fd)
|
||||
assert list(j2) == []
|
||||
|
||||
j3 = journal.Reader(journal.CURRENT_USER, path=fd)
|
||||
--
|
||||
2.10.0
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
From 8024fc61719d15b47ace1973b6b901881e17ff2f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Thu, 22 Sep 2016 20:41:21 -0400
|
||||
Subject: [PATCH 5/6] _reader: use proper ifdef guard for sd_j_open_files_fd
|
||||
|
||||
---
|
||||
systemd/_reader.c | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/systemd/_reader.c b/systemd/_reader.c
|
||||
index 0f6fd3f..3a2c218 100644
|
||||
--- a/systemd/_reader.c
|
||||
+++ b/systemd/_reader.c
|
||||
@@ -283,7 +283,6 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
|
||||
Py_END_ALLOW_THREADS
|
||||
}
|
||||
} else if (_files) {
|
||||
-#ifdef HAVE_JOURNAL_OPEN_FILES
|
||||
_cleanup_Py_DECREF_ PyObject *item0 = NULL;
|
||||
|
||||
item0 = PySequence_GetItem(_files, 0);
|
||||
@@ -293,9 +292,13 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
|
||||
if (!strv_converter(_files, &files))
|
||||
return -1;
|
||||
|
||||
+#ifdef HAVE_JOURNAL_OPEN_FILES
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
r = sd_journal_open_files(&self->j, (const char**) files, flags);
|
||||
Py_END_ALLOW_THREADS
|
||||
+#else
|
||||
+ r = -ENOSYS;
|
||||
+#endif
|
||||
} else {
|
||||
_cleanup_free_ int *fds = NULL;
|
||||
size_t n_fds;
|
||||
@@ -303,13 +306,14 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
|
||||
if (!intlist_converter(_files, &fds, &n_fds))
|
||||
return -1;
|
||||
|
||||
+#ifdef HAVE_JOURNAL_OPEN_DIRECTORY_FD
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
r = sd_journal_open_files_fd(&self->j, fds, n_fds, flags);
|
||||
Py_END_ALLOW_THREADS
|
||||
- }
|
||||
#else
|
||||
- r = -ENOSYS;
|
||||
+ r = -ENOSYS;
|
||||
#endif
|
||||
+ }
|
||||
} else {
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
r = sd_journal_open(&self->j, flags);
|
||||
--
|
||||
2.10.0
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
From 911591a1188e03942e60f2ab1abf91562904f49e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Thu, 22 Sep 2016 20:24:31 -0400
|
||||
Subject: [PATCH 6/6] build-sys: import "pytest" instead of "py.test"
|
||||
|
||||
Fixes the following error in rawhide:
|
||||
/usr/bin/python3: loader for pytest cannot handle py.test
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 23b452e..b10d6d9 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -51,7 +51,7 @@ sphinx-%: build
|
||||
@echo Output has been generated in build/$*
|
||||
|
||||
check: build
|
||||
- (cd $(builddir) && $(PYTHON) -m py.test . ../../docs $(TESTFLAGS))
|
||||
+ (cd $(builddir) && $(PYTHON) -m pytest . ../../docs $(TESTFLAGS))
|
||||
|
||||
www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/python-systemd
|
||||
doc-sync:
|
||||
--
|
||||
2.10.0
|
||||
|
||||
Reference in New Issue
Block a user