14
0

- 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
This commit is contained in:
2022-02-07 06:37:49 +00:00
committed by Git OBS Bridge
parent d02b483aba
commit 8778241533
12 changed files with 73 additions and 36 deletions

View File

@@ -1,5 +1,5 @@
python-prctl - A python(ic) interface to the prctl syscall python-prctl - A python(ic) interface to the prctl syscall
Copyright (C) 2010-2018 Dennis Kaarsemaker <dennis@kaarsemaker.net> Copyright (C) 2010-2020 Dennis Kaarsemaker <dennis@kaarsemaker.net>
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by

View File

@@ -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.8.1.orig/_prctlmodule.c
+++ python-prctl-1.7/_prctlmodule.c +++ python-prctl-1.8.1/_prctlmodule.c
@@ -50,6 +50,7 @@ prctl_prctl(PyObject *self, PyObject *ar @@ -51,6 +51,7 @@ prctl_prctl(PyObject *self, PyObject *ar
{
long option = 0; long option = 0;
long arg = 0; long arg = 0;
long arg2 = 0;
+ int intarg = 0; + int intarg = 0;
char *argstr = NULL; char *argstr = NULL;
char name[17] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; char name[17] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
int result; 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 #ifdef PR_GET_TID_ADDRESS
case(PR_GET_TID_ADDRESS): case(PR_GET_TID_ADDRESS):
#endif #endif

View File

@@ -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 \

View File

@@ -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:

View File

@@ -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.8.1.orig/test_prctl.py
+++ python-prctl-1.7/test_prctl.py +++ python-prctl-1.8.1/test_prctl.py
@@ -189,6 +189,7 @@ class PrctlTest(unittest.TestCase): @@ -240,6 +240,7 @@ class PrctlTest(unittest.TestCase):
self.assertNotEqual(sp.returncode, 0) else:
os._exit(0) self.assertRaises(OSError, prctl.pac_reset_keys, prctl.PAC_APIAKEY)
+ @unittest.skip('borked in sandbox') + @unittest.skip('borked in sandbox')
def test_proctitle(self): def test_proctitle(self):
"""Test setting the process title, including too long titles""" """Test setting the process title, including too long titles"""
title = "This is a test!" with open('/proc/self/cmdline') as fd:

View File

@@ -1,8 +1,8 @@
Index: b/test_prctl.py Index: python-prctl-1.8.1/test_prctl.py
=================================================================== ===================================================================
--- a/test_prctl.py --- python-prctl-1.8.1.orig/test_prctl.py
+++ b/test_prctl.py +++ python-prctl-1.8.1/test_prctl.py
@@ -220,6 +220,7 @@ class PrctlTest(unittest.TestCase): @@ -259,6 +259,7 @@ class PrctlTest(unittest.TestCase):
self.assertEqual(prctl.get_name(), name[:15]) self.assertEqual(prctl.get_name(), name[:15])
@require('get_no_new_privs') @require('get_no_new_privs')

View File

@@ -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.8.1.orig/test_prctl.py
+++ python-prctl-1.7/test_prctl.py +++ python-prctl-1.8.1/test_prctl.py
@@ -155,6 +155,7 @@ class PrctlTest(unittest.TestCase): @@ -182,6 +182,7 @@ class PrctlTest(unittest.TestCase):
self.assertEqual(prctl.get_keepcaps(), False) self.assertEqual(prctl.get_keepcaps(), False)
@require('set_mce_kill') @require('set_mce_kill')
+ @unittest.skipIf(sys.maxsize <= 2**32 or arch == 's390x', 'no such file on this architecture') + @unittest.skipIf(sys.maxsize <= 2**32 or arch == 's390x', 'no such file on this architecture')
def test_mce_kill(self): def test_mce_kill(self):
"""Test the MCE_KILL setting""" """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'):

View File

@@ -1,7 +1,8 @@
diff -ur python-prctl-1.7.orig/test_prctl.py python-prctl-1.7/test_prctl.py Index: python-prctl-1.8.1/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 --- python-prctl-1.8.1.orig/test_prctl.py
@@ -44,6 +44,8 @@ +++ python-prctl-1.8.1/test_prctl.py
@@ -45,6 +45,8 @@ def require(attr):
class PrctlTest(unittest.TestCase): class PrctlTest(unittest.TestCase):
# There are architecture specific tests # There are architecture specific tests
arch = os.uname()[4] 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 # prctl behaviour differs when root, so you should test as root and non-root
am_root = os.geteuid() == 0 am_root = os.geteuid() == 0
@@ -110,6 +112,7 @@ @@ -111,6 +113,7 @@ class PrctlTest(unittest.TestCase):
self.assertEqual(prctl.get_dumpable(), False) self.assertEqual(prctl.get_dumpable(), False)
self.assertRaises(TypeError, prctl.get_dumpable, "42") 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): def test_endian(self):
"""Test manipulation of the endianness setting""" """Test manipulation of the endianness setting"""
if self.arch == 'powerpc': 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.get_fpemu)
self.assertRaises(OSError, prctl.set_fpemu, prctl.FPEMU_SIGFPE) self.assertRaises(OSError, prctl.set_fpemu, prctl.FPEMU_SIGFPE)

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:57ebd556616d6ffe1f794f514680e84a03737cb070de37722198d7ad6c8f4fda
size 24716

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b4ca9a25a7d4f1ace4fffd1f3a2e64ef5208fe05f929f3edd5e27081ca7e67ce
size 28033

View File

@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Feb 7 06:34:21 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- 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 <hpj@urpla.net> Tue Oct 27 09:54:52 UTC 2020 - Hans-Peter Jansen <hpj@urpla.net>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-python-prctl # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-python-prctl Name: python-python-prctl
Version: 1.7 Version: 1.8.1
Release: 0 Release: 0
Summary: Python(ic) interface to the linux prctl syscall Summary: Python(ic) interface to the linux prctl syscall
License: GPL-3.0-or-later License: GPL-3.0-or-later
@@ -30,6 +30,8 @@ Patch1: memory_failure_early_kill.patch
Patch2: bigendian.patch Patch2: bigendian.patch
Patch3: powerpc.patch Patch3: powerpc.patch
Patch4: disable_no_new_privs.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 devel}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: fdupes 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. and allows you to set the process name as seen in ps and top.
%prep %prep
%setup -q -n python-prctl-%{version} %autosetup -p1 -n python-prctl-%{version}
%autopatch -p1
cp %{SOURCE99} . cp %{SOURCE99} .
%build %build