diff --git a/backport-Make-Python-test-script-compatible-with-Python2-and-Python3.patch b/backport-Make-Python-test-script-compatible-with-Python2-and-Python3.patch new file mode 100644 index 0000000000000000000000000000000000000000..ab312f5fd996a74fe696156b646fc6a979fe168c --- /dev/null +++ b/backport-Make-Python-test-script-compatible-with-Python2-and-Python3.patch @@ -0,0 +1,37 @@ +From 6a6f22d6e99c973bf2f9f400d52370107ae9396b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?H=C3=A5vard?= +Date: Thu, 26 May 2022 21:26:55 +0000 +Subject: [PATCH] Make Python test script compatible with Python 2 and Python + 3. (#35) + +The shebang line is still restricting it to Python 2. +Removed end-of-line whitespace as well. +--- + bindings/python/test/capng-test.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/bindings/python/test/capng-test.py b/bindings/python/test/capng-test.py +index 6688e77..e6350ec 100755 +--- a/bindings/python/test/capng-test.py ++++ b/bindings/python/test/capng-test.py +@@ -14,7 +14,7 @@ try: + with open('/proc/sys/kernel/cap_last_cap', 'r') as f: + last = int(f.readline()) + except IOError as e: +- print "Error opening /proc/sys/kernel/cap_last_cap: {0}".format(e.strerror) ++ print("Error opening /proc/sys/kernel/cap_last_cap: {0}".format(e.strerror)) + + print("Doing basic bit tests...") + capng.capng_clear(capng.CAPNG_SELECT_BOTH) +@@ -49,7 +49,7 @@ for i in range(last+1): + if capng.capng_have_capabilities(capng.CAPNG_SELECT_CAPS) != capng.CAPNG_PARTIAL: + print("Failed have capabilities test 1") + sys.exit(1) +- ++ + capng.capng_fill(capng.CAPNG_SELECT_BOTH) + rc = capng.capng_update(capng.CAPNG_DROP, capng.CAPNG_EFFECTIVE, i) + if rc: +-- +2.27.0 + diff --git a/libcap-ng.spec b/libcap-ng.spec index da93b1e7c2b0bf4dd09e9c476c6ae5fcc0138d3e..8db835ca00912d643bc0af10009e486d3860209d 100644 --- a/libcap-ng.spec +++ b/libcap-ng.spec @@ -3,10 +3,13 @@ Summary: Libcap-ng is a library used for posix capabilities programming Name: libcap-ng Version: 0.8.2 -Release: 1 +Release: 2 License: LGPLv2+ and GPLv2+ URL: http://people.redhat.com/sgrubb/libcap-ng Source0: https://people.redhat.com/sgrubb/libcap-ng/%{name}-%{version}.tar.gz + +Patch1: backport-Make-Python-test-script-compatible-with-Python2-and-Python3.patch + BuildRequires: gcc, kernel-headers >= 2.6.11, libattr-devel Provides: %{name}-utils = %{version}-%{release} Obsoletes: %{name}-utils < %{version}-%{release} @@ -96,6 +99,12 @@ make check %attr(0644,root,root) %{_mandir}/man7/* %changelog +* Wed Oct 19 2022 yixiangzhike - 0.8.2-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:make Python test script compatible with Python2 and Python3 + * Thu Nov 25 2021 yixiangzhike - 0.8.2-1 - Type:enhancement - ID:NA