public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/openscap] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
@ 2026-07-28 19:58 Jitka Plesnikova
  0 siblings, 0 replies; only message in thread
From: Jitka Plesnikova @ 2026-07-28 19:58 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/openscap
Branch : rawhide
Commit : 9d0a7011f6a3ffe759c641b0218ac4098879eeb3
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date   : 2026-07-28T15:29:18+02:00
Stats  : +77/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/openscap/c/9d0a7011f6a3ffe759c641b0218ac4098879eeb3?branch=rawhide

Log:
Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility

---
diff --git a/openscap-swig45.patch b/openscap-swig45.patch
new file mode 100644
index 0000000..dc2a834
--- /dev/null
+++ b/openscap-swig45.patch
@@ -0,0 +1,70 @@
+diff -up openscap-1.4.4/swig/openscap.i.swig45 openscap-1.4.4/swig/openscap.i
+--- openscap-1.4.4/swig/openscap.i.swig45	2026-07-28 10:17:00.633186873 +0200
++++ openscap-1.4.4/swig/openscap.i	2026-07-28 10:17:00.636186937 +0200
+@@ -48,8 +48,8 @@
+ {
+     if (PyLong_Check($input))
+         $1 = (time_t) PyLong_AsLong($input);
+-    else if (PyInt_Check($input))
+-        $1 = (time_t) PyInt_AsLong($input);
++    else if (PyLong_Check($input))
++        $1 = (time_t) PyLong_AsLong($input);
+     else if (PyFloat_Check($input))
+         $1 = (time_t) PyFloat_AsDouble($input);
+     else {
+@@ -80,8 +80,8 @@
+     $1 = (char **) malloc((size+1)*sizeof(char *));
+     for (i = 0; i < size; i++) {
+       PyObject *o = PyList_GetItem($input,i);
+-      /*if (PyString_Check(o))*/
+-        $1[i] = PyString_AsString(PyList_GetItem($input,i));
++      /*if (PyBytes_Check(o))*/
++        $1[i] = PyBytes_AsString(PyList_GetItem($input,i));
+       /*else {
+         PyErr_SetString(PyExc_TypeError,"list must contain strings");
+         free($1);
+@@ -329,7 +329,7 @@ int rule_result_output_callback_wrapper(
+         return -1;
+     }
+     Py_DECREF(arglist);
+-    dres = PyInt_AsLong(result);
++    dres = PyLong_AsLong(result);
+     Py_XDECREF(result);
+     PyGILState_Release(state);
+     return dres;
+@@ -366,7 +366,7 @@ int rule_start_callback_wrapper(struct x
+         return -1;
+     }
+     Py_DECREF(arglist);
+-    dres = PyInt_AsLong(result);
++    dres = PyLong_AsLong(result);
+     Py_XDECREF(result);
+     PyGILState_Release(state);
+     return dres;
+@@ -403,7 +403,7 @@ int agent_reporter_callback_wrapper(cons
+         return -1;
+     }
+     Py_DECREF(arglist);
+-    dres = PyInt_AsLong(result);
++    dres = PyLong_AsLong(result);
+     Py_XDECREF(result);
+     PyGILState_Release(state);
+     return dres;
+@@ -438,7 +438,7 @@ int validate_callback_wrapper(const char
+         return -1;
+     }
+     Py_DECREF(arglist);
+-    dres = PyInt_AsLong(result);
++    dres = PyLong_AsLong(result);
+     Py_XDECREF(result);
+     PyGILState_Release(state);
+     return dres;
+@@ -474,7 +474,7 @@ char * sub_callback_wrapper(xccdf_subst_
+         return NULL;
+     }
+     Py_DECREF(arglist);
+-    dres = PyString_AsString(result);
++    dres = PyBytes_AsString(result);
+     if (dres == NULL) {
+         if (PyErr_Occurred() != NULL)
+             PyErr_PrintEx(0);

diff --git a/openscap.spec b/openscap.spec
index 3a843bc..83bdd1d 100644
--- a/openscap.spec
+++ b/openscap.spec
@@ -1,6 +1,6 @@
 Name:           openscap
 Version:        1.4.4
-Release:        8%{?dist}
+Release:        9%{?dist}
 Epoch:          1
 Summary:        Set of open source libraries enabling integration of the SCAP line of standards
 License:        LGPL-2.1-or-later
@@ -9,6 +9,9 @@ VCS:            git:https://github.com/OpenSCAP/openscap
 Source0:        https://github.com/OpenSCAP/openscap/releases/download/%{version}/%{name}-%{version}.tar.gz
 Patch0:         2343.patch
 Patch1:         2360.patch
+# Replace removed Python 2 C API macros with Python 3 equivalents
+# for compatibility with SWIG 4.5.0
+Patch2:         openscap-swig45.patch
 
 %global         common_description %{expand:
 OpenSCAP is a set of open source libraries providing an easier path
@@ -322,6 +325,9 @@ pathfix.py -i %{__python3} -p -n %{buildroot}%{_bindir}/scap-as-rpm
 %{_mandir}/man8/oscap-podman.8*
 
 %changelog
+* Tue Jul 28 2026 Jitka Plesnikova <jplesnik@redhat.com> - 1:1.4.4-9
+- Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
+
 * Fri Jul 24 2026 Python Maint <python-maint@redhat.com> - 1:1.4.4-8
 - Rebuilt for Python 3.15.0b4 ABI change
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-28 19:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-28 19:58 [rpms/openscap] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility Jitka Plesnikova

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox