Skip to content

Commit 5300ced

Browse files
dgarciabmwiedemann
authored andcommitted
Update python-dmidecode to version 3.12.3 / rev 13 via SR 1216962
https://build.opensuse.org/request/show/1216962 by user dgarcia + anag+factory - Add gcc14.patch to make it compatible with gcc14 gh#nima/python-dmidecode#59
1 parent 73f667c commit 5300ced

5 files changed

Lines changed: 91 additions & 0 deletions

File tree

packages/p/python-dmidecode/.files

49 Bytes
Binary file not shown.

packages/p/python-dmidecode/.rev

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,13 @@
148148
</comment>
149149
<requestid>1146398</requestid>
150150
</revision>
151+
<revision rev="13" vrev="6">
152+
<srcmd5>6895d99dd291bc09ce576db51d3128ff</srcmd5>
153+
<version>3.12.3</version>
154+
<time>1729601620</time>
155+
<user>anag+factory</user>
156+
<comment>- Add gcc14.patch to make it compatible with gcc14
157+
gh#nima/python-dmidecode#59</comment>
158+
<requestid>1216962</requestid>
159+
</revision>
151160
</revisionlist>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
Index: python-dmidecode-3.12.3/src/dmidecodemodule.c
2+
===================================================================
3+
--- python-dmidecode-3.12.3.orig/src/dmidecodemodule.c
4+
+++ python-dmidecode-3.12.3/src/dmidecodemodule.c
5+
@@ -54,13 +54,13 @@
6+
#include <mcheck.h>
7+
8+
#if (PY_VERSION_HEX < 0x03030000)
9+
-char *PyUnicode_AsUTF8(PyObject *unicode) {
10+
+const char *PyUnicode_AsUTF8(PyObject *unicode) {
11+
PyObject *as_bytes = PyUnicode_AsUTF8String(unicode);
12+
if (!as_bytes) {
13+
return NULL;
14+
}
15+
16+
- return PyBytes_AsString(as_bytes);
17+
+ return (const char*)PyBytes_AsString(as_bytes);
18+
}
19+
#endif
20+
21+
@@ -479,7 +479,7 @@ xmlNode *__dmidecode_xml_getsection(opti
22+
if(opt->type == -1) {
23+
char *err = log_retrieve(opt->logdata, LOG_ERR);
24+
log_clear_partial(opt->logdata, LOG_ERR, 0);
25+
- _pyReturnError(PyExc_RuntimeError, "Invalid type id '%s' -- %s", typeid, err);
26+
+ PyReturnError(PyExc_RuntimeError, "Invalid type id '%s' -- %s", typeid, err);
27+
free(err);
28+
return NULL;
29+
}
30+
@@ -657,7 +657,7 @@ static PyObject *dmidecode_get_slot(PyOb
31+
32+
static PyObject *dmidecode_get_section(PyObject *self, PyObject *args)
33+
{
34+
- char *section = NULL;
35+
+ const char *section = NULL;
36+
if (PyUnicode_Check(args)) {
37+
section = PyUnicode_AsUTF8(args);
38+
} else if (PyBytes_Check(args)) {
39+
@@ -788,7 +788,7 @@ static PyObject *dmidecode_get_dev(PyObj
40+
41+
static PyObject *dmidecode_set_dev(PyObject * self, PyObject * arg)
42+
{
43+
- char *f = NULL;
44+
+ const char *f = NULL;
45+
if(PyUnicode_Check(arg)) {
46+
f = PyUnicode_AsUTF8(arg);
47+
} else if(PyBytes_Check(arg)) {
48+
@@ -835,7 +835,7 @@ static PyObject *dmidecode_set_dev(PyObj
49+
50+
static PyObject *dmidecode_set_pythonxmlmap(PyObject * self, PyObject * arg)
51+
{
52+
- char *fname = NULL;
53+
+ const char *fname = NULL;
54+
55+
if (PyUnicode_Check(arg)) {
56+
fname = PyUnicode_AsUTF8(arg);
57+
@@ -913,7 +913,7 @@ static PyMethodDef DMIDataMethods[] = {
58+
{(char *)"pythonmap", dmidecode_set_pythonxmlmap, METH_O,
59+
(char *) "Use another python dict map definition. The default file is " PYTHON_XML_MAP},
60+
61+
- {(char *)"xmlapi", dmidecode_xmlapi, METH_VARARGS | METH_KEYWORDS,
62+
+ {(char *)"xmlapi", (PyCFunction)dmidecode_xmlapi, METH_VARARGS | METH_KEYWORDS,
63+
(char *) "Internal API for retrieving data as raw XML data"},
64+
65+
66+
@@ -1024,7 +1024,7 @@ initdmidecodemod(void)
67+
// Assign this options struct to the module as well with a destructor, that way it will
68+
// clean up the memory for us.
69+
// TODO: destructor has wrong type under py3?
70+
- PyModule_AddObject(module, "options", PyCapsule_New(opt, NULL, destruct_options));
71+
+ PyModule_AddObject(module, "options", PyCapsule_New(opt, NULL, (PyCapsule_Destructor)destruct_options));
72+
global_options = opt;
73+
#ifdef IS_PY3K
74+
return module;

packages/p/python-dmidecode/python-dmidecode.changes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
-------------------------------------------------------------------
2+
Tue Oct 22 06:56:53 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
3+
4+
- Add gcc14.patch to make it compatible with gcc14
5+
gh#nima/python-dmidecode#59
6+
17
-------------------------------------------------------------------
28
Tue Feb 13 12:46:21 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
39

packages/p/python-dmidecode/python-dmidecode.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Patch2: 31-version_info-v-version.patch
3737
# PATCH-FIX-UPSTREAM detect-lib-with-py3.patch gh#nima/python-dmidecode#36 mcepl@suse.com
3838
# Make the code future-proof against removal of distutils module.
3939
Patch3: detect-lib-with-py3.patch
40+
# PATCH-FIX-UPSTREAM gcc14.patch gh#nima/python-dmidecode#59 -- daniel.garcia@suse.com
41+
Patch4: gcc14.patch
4042
BuildRequires: %{python_module devel}
4143
BuildRequires: %{python_module setuptools}
4244
BuildRequires: fdupes

0 commit comments

Comments
 (0)