From 87782415337a1a822400b7421e383bf9e59b85ad3c7863c6a4582571fd41eb4b Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 7 Feb 2022 06:37:49 +0000 Subject: [PATCH] - Update to 1.8.1: * No changelog. - Rebase all patches. - Add patch check-for-python310-correctly.patch: * Check for Python 3.10 correctly. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-prctl?expand=0&rev=9 --- COPYING | 2 +- bigendian.patch | 12 ++++++------ check-for-python310-correctly.patch | 13 +++++++++++++ correct-uname-comparsion.patch | 13 +++++++++++++ disable-sandboxed-test.patch | 14 +++++++------- disable_no_new_privs.patch | 8 ++++---- memory_failure_early_kill.patch | 10 +++++----- powerpc.patch | 13 +++++++------ python-prctl-1.7.tar.gz | 3 --- python-prctl-1.8.1.tar.gz | 3 +++ python-python-prctl.changes | 9 +++++++++ python-python-prctl.spec | 9 +++++---- 12 files changed, 73 insertions(+), 36 deletions(-) create mode 100644 check-for-python310-correctly.patch create mode 100644 correct-uname-comparsion.patch delete mode 100644 python-prctl-1.7.tar.gz create mode 100644 python-prctl-1.8.1.tar.gz diff --git a/COPYING b/COPYING index 8509827..cc5cd81 100644 --- a/COPYING +++ b/COPYING @@ -1,5 +1,5 @@ python-prctl - A python(ic) interface to the prctl syscall -Copyright (C) 2010-2018 Dennis Kaarsemaker +Copyright (C) 2010-2020 Dennis Kaarsemaker This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/bigendian.patch b/bigendian.patch index d21da50..0c69604 100644 --- a/bigendian.patch +++ b/bigendian.patch @@ -1,16 +1,16 @@ -Index: python-prctl-1.7/_prctlmodule.c +Index: python-prctl-1.8.1/_prctlmodule.c =================================================================== ---- python-prctl-1.7.orig/_prctlmodule.c -+++ python-prctl-1.7/_prctlmodule.c -@@ -50,6 +50,7 @@ prctl_prctl(PyObject *self, PyObject *ar - { +--- python-prctl-1.8.1.orig/_prctlmodule.c ++++ python-prctl-1.8.1/_prctlmodule.c +@@ -51,6 +51,7 @@ prctl_prctl(PyObject *self, PyObject *ar long option = 0; long arg = 0; + long arg2 = 0; + int intarg = 0; char *argstr = NULL; char name[17] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; int result; -@@ -286,12 +287,12 @@ prctl_prctl(PyObject *self, PyObject *ar +@@ -378,12 +379,12 @@ prctl_prctl(PyObject *self, PyObject *ar #ifdef PR_GET_TID_ADDRESS case(PR_GET_TID_ADDRESS): #endif diff --git a/check-for-python310-correctly.patch b/check-for-python310-correctly.patch new file mode 100644 index 0000000..f4ec399 --- /dev/null +++ b/check-for-python310-correctly.patch @@ -0,0 +1,13 @@ +Index: python-prctl-1.8.1/test_prctl.py +=================================================================== +--- python-prctl-1.8.1.orig/test_prctl.py ++++ python-prctl-1.8.1/test_prctl.py +@@ -20,7 +20,7 @@ except ImportError: + pass + + curdir = os.path.dirname(__file__) +-builddir = os.path.join(curdir, 'build', 'lib.%s-%s' % (distutils.util.get_platform(), sys.version[0:3])) ++builddir = os.path.join(curdir, 'build', 'lib.%s-%s' % (distutils.util.get_platform(), '.'.join([str(x) for x in sys.version_info[:2]]))) + + # Always run from the builddir + if not os.path.exists(builddir) or \ diff --git a/correct-uname-comparsion.patch b/correct-uname-comparsion.patch new file mode 100644 index 0000000..569cd3c --- /dev/null +++ b/correct-uname-comparsion.patch @@ -0,0 +1,13 @@ +Index: python-prctl-1.8.1/test_prctl.py +=================================================================== +--- python-prctl-1.8.1.orig/test_prctl.py ++++ python-prctl-1.8.1/test_prctl.py +@@ -245,7 +245,7 @@ class PrctlTest(unittest.TestCase): + @require('mpx_enable_management') + def test_mpx(self): + """Test MPX enabling/disabling""" +- if os.uname().release > "5.4": ++ if tuple(int(x) for x in os.uname().release.split('.')[:2]) > (5, 4): + self.assertRaises(OSError, prctl.mpx_enable_management) + self.assertRaises(OSError, prctl.mpx_disable_management) + else: diff --git a/disable-sandboxed-test.patch b/disable-sandboxed-test.patch index e274f6b..ca186eb 100644 --- a/disable-sandboxed-test.patch +++ b/disable-sandboxed-test.patch @@ -1,12 +1,12 @@ -Index: python-prctl-1.7/test_prctl.py +Index: python-prctl-1.8.1/test_prctl.py =================================================================== ---- python-prctl-1.7.orig/test_prctl.py -+++ python-prctl-1.7/test_prctl.py -@@ -189,6 +189,7 @@ class PrctlTest(unittest.TestCase): - self.assertNotEqual(sp.returncode, 0) - os._exit(0) +--- python-prctl-1.8.1.orig/test_prctl.py ++++ python-prctl-1.8.1/test_prctl.py +@@ -240,6 +240,7 @@ class PrctlTest(unittest.TestCase): + else: + self.assertRaises(OSError, prctl.pac_reset_keys, prctl.PAC_APIAKEY) + @unittest.skip('borked in sandbox') def test_proctitle(self): """Test setting the process title, including too long titles""" - title = "This is a test!" + with open('/proc/self/cmdline') as fd: diff --git a/disable_no_new_privs.patch b/disable_no_new_privs.patch index d547e1b..84151b7 100644 --- a/disable_no_new_privs.patch +++ b/disable_no_new_privs.patch @@ -1,8 +1,8 @@ -Index: b/test_prctl.py +Index: python-prctl-1.8.1/test_prctl.py =================================================================== ---- a/test_prctl.py -+++ b/test_prctl.py -@@ -220,6 +220,7 @@ class PrctlTest(unittest.TestCase): +--- python-prctl-1.8.1.orig/test_prctl.py ++++ python-prctl-1.8.1/test_prctl.py +@@ -259,6 +259,7 @@ class PrctlTest(unittest.TestCase): self.assertEqual(prctl.get_name(), name[:15]) @require('get_no_new_privs') diff --git a/memory_failure_early_kill.patch b/memory_failure_early_kill.patch index 2c37ece..1658ce3 100644 --- a/memory_failure_early_kill.patch +++ b/memory_failure_early_kill.patch @@ -1,12 +1,12 @@ -Index: python-prctl-1.7/test_prctl.py +Index: python-prctl-1.8.1/test_prctl.py =================================================================== ---- python-prctl-1.7.orig/test_prctl.py -+++ python-prctl-1.7/test_prctl.py -@@ -155,6 +155,7 @@ class PrctlTest(unittest.TestCase): +--- python-prctl-1.8.1.orig/test_prctl.py ++++ python-prctl-1.8.1/test_prctl.py +@@ -182,6 +182,7 @@ class PrctlTest(unittest.TestCase): self.assertEqual(prctl.get_keepcaps(), False) @require('set_mce_kill') + @unittest.skipIf(sys.maxsize <= 2**32 or arch == 's390x', 'no such file on this architecture') def test_mce_kill(self): """Test the MCE_KILL setting""" - fd = open('/proc/sys/vm/memory_failure_early_kill') + if not os.path.exists('/proc/sys/vm/memory_failure_early_kill'): diff --git a/powerpc.patch b/powerpc.patch index d5ea4b7..257c8f8 100644 --- a/powerpc.patch +++ b/powerpc.patch @@ -1,7 +1,8 @@ -diff -ur python-prctl-1.7.orig/test_prctl.py python-prctl-1.7/test_prctl.py ---- python-prctl-1.7.orig/test_prctl.py 2020-09-07 11:09:38.544700725 +0200 -+++ python-prctl-1.7/test_prctl.py 2020-09-07 12:28:11.482301401 +0200 -@@ -44,6 +44,8 @@ +Index: python-prctl-1.8.1/test_prctl.py +=================================================================== +--- python-prctl-1.8.1.orig/test_prctl.py ++++ python-prctl-1.8.1/test_prctl.py +@@ -45,6 +45,8 @@ def require(attr): class PrctlTest(unittest.TestCase): # There are architecture specific tests arch = os.uname()[4] @@ -10,7 +11,7 @@ diff -ur python-prctl-1.7.orig/test_prctl.py python-prctl-1.7/test_prctl.py # prctl behaviour differs when root, so you should test as root and non-root am_root = os.geteuid() == 0 -@@ -110,6 +112,7 @@ +@@ -111,6 +113,7 @@ class PrctlTest(unittest.TestCase): self.assertEqual(prctl.get_dumpable(), False) self.assertRaises(TypeError, prctl.get_dumpable, "42") @@ -18,7 +19,7 @@ diff -ur python-prctl-1.7.orig/test_prctl.py python-prctl-1.7/test_prctl.py def test_endian(self): """Test manipulation of the endianness setting""" if self.arch == 'powerpc': -@@ -136,13 +139,55 @@ +@@ -137,13 +140,55 @@ class PrctlTest(unittest.TestCase): self.assertRaises(OSError, prctl.get_fpemu) self.assertRaises(OSError, prctl.set_fpemu, prctl.FPEMU_SIGFPE) diff --git a/python-prctl-1.7.tar.gz b/python-prctl-1.7.tar.gz deleted file mode 100644 index 7d9693c..0000000 --- a/python-prctl-1.7.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:57ebd556616d6ffe1f794f514680e84a03737cb070de37722198d7ad6c8f4fda -size 24716 diff --git a/python-prctl-1.8.1.tar.gz b/python-prctl-1.8.1.tar.gz new file mode 100644 index 0000000..4754952 --- /dev/null +++ b/python-prctl-1.8.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4ca9a25a7d4f1ace4fffd1f3a2e64ef5208fe05f929f3edd5e27081ca7e67ce +size 28033 diff --git a/python-python-prctl.changes b/python-python-prctl.changes index 5887fce..d5687f1 100644 --- a/python-python-prctl.changes +++ b/python-python-prctl.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Feb 7 06:34:21 UTC 2022 - Steve Kowalik + +- Update to 1.8.1: + * No changelog. +- Rebase all patches. +- Add patch check-for-python310-correctly.patch: + * Check for Python 3.10 correctly. + ------------------------------------------------------------------- Tue Oct 27 09:54:52 UTC 2020 - Hans-Peter Jansen diff --git a/python-python-prctl.spec b/python-python-prctl.spec index 71ffd5d..2f803bd 100644 --- a/python-python-prctl.spec +++ b/python-python-prctl.spec @@ -1,7 +1,7 @@ # # spec file for package python-python-prctl # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-python-prctl -Version: 1.7 +Version: 1.8.1 Release: 0 Summary: Python(ic) interface to the linux prctl syscall License: GPL-3.0-or-later @@ -30,6 +30,8 @@ Patch1: memory_failure_early_kill.patch Patch2: bigendian.patch Patch3: powerpc.patch Patch4: disable_no_new_privs.patch +Patch5: correct-uname-comparsion.patch +Patch6: check-for-python310-correctly.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -50,8 +52,7 @@ Besides prctl, this library also wraps libcap for complete capability handling and allows you to set the process name as seen in ps and top. %prep -%setup -q -n python-prctl-%{version} -%autopatch -p1 +%autosetup -p1 -n python-prctl-%{version} cp %{SOURCE99} . %build