summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Cafarelli <voyageur@gentoo.org>2023-04-02 20:29:02 +0200
committerBernard Cafarelli <voyageur@gentoo.org>2023-04-02 20:29:54 +0200
commit38fd2191f8e4fe49055e5dd4aea3e4815ad114c4 (patch)
tree2cc3d4414a260a05deb8bb6334b419e4eca18a9f /app-backup/rdiff-backup/files
parentnet-mail/mu: drop obsolete patch (diff)
downloadgentoo-38fd2191f8e4fe49055e5dd4aea3e4815ad114c4.tar.gz
gentoo-38fd2191f8e4fe49055e5dd4aea3e4815ad114c4.tar.bz2
gentoo-38fd2191f8e4fe49055e5dd4aea3e4815ad114c4.zip
app-backup/rdiff-backup: backport py3.11 support to current stable
2.2 changes a few things, so will move to stable a bit later Closes: https://bugs.gentoo.org/903135 Signed-off-by: Bernard Cafarelli <voyageur@gentoo.org>
Diffstat (limited to 'app-backup/rdiff-backup/files')
-rw-r--r--app-backup/rdiff-backup/files/rdiff-backup-2.0.5-py311.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/app-backup/rdiff-backup/files/rdiff-backup-2.0.5-py311.patch b/app-backup/rdiff-backup/files/rdiff-backup-2.0.5-py311.patch
new file mode 100644
index 000000000000..87531ca7c4a6
--- /dev/null
+++ b/app-backup/rdiff-backup/files/rdiff-backup-2.0.5-py311.patch
@@ -0,0 +1,42 @@
+From 5e5cc54b5a633d3c6c0469283b2f26dbdde7908f Mon Sep 17 00:00:00 2001
+From: Frank Crawford <frank@crawford.emu.id.au>
+Date: Sun, 2 Jan 2022 18:44:57 +1100
+Subject: [PATCH] Added patch for Python3.11 as per bpo-39573.
+
+---
+ src/_librsyncmodule.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/src/_librsyncmodule.c b/src/_librsyncmodule.c
+index a46567fc4..158104d2e 100644
+--- a/src/_librsyncmodule.c
++++ b/src/_librsyncmodule.c
+@@ -25,6 +25,16 @@
+ #include <librsync.h>
+ #define RSM_JOB_BLOCKSIZE 65536
+
++/* ----------------------------------------------------------------------- *
++ * Update for Python 3.11 - Contributed by Victor Stinner in bpo-39573.
++ * Compatibility macro for older Python versions.
++ * ----------------------------------------------------------------------- */
++#if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_TYPE)
++static inline void _Py_SET_TYPE(PyObject *ob, PyTypeObject *type)
++{ ob->ob_type = type; }
++#define Py_SET_TYPE(ob, type) _Py_SET_TYPE((PyObject*)(ob), type)
++#endif
++
+ static PyObject *librsyncError;
+
+ /* Sets python error string from result */
+@@ -540,8 +550,9 @@ PyMODINIT_FUNC PyInit__librsync(void)
+ {
+ PyObject *m, *d;
+
+- Py_TYPE(&_librsync_SigMakerType) = &PyType_Type;
+- Py_TYPE(&_librsync_DeltaMakerType) = &PyType_Type;
++ /* Update for Python 3.11 - bpo-39573. */
++ Py_SET_TYPE(&_librsync_SigMakerType, &PyType_Type);
++ Py_SET_TYPE(&_librsync_DeltaMakerType, &PyType_Type);
+ static struct PyModuleDef librsync_def = {
+ PyModuleDef_HEAD_INIT, "_librsync", "RSync Lib", -1, _librsyncMethods, };
+ m = PyModule_Create(&librsync_def);