summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/libdnf
diff options
context:
space:
mode:
authorJoe Slater <joe.slater@windriver.com>2020-03-05 14:04:54 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-06 08:19:12 +0000
commitbc9402d77a982ff71bd919837b4736f586aa04cf (patch)
treebe6dc05cee42221ba02d0ab6e1cf2c2d31027c6f /meta/recipes-devtools/libdnf
parent03e6d0f787cbd62156a163bfbcaed68bfcd379e8 (diff)
downloadopenembedded-core-contrib-bc9402d77a982ff71bd919837b4736f586aa04cf.tar.gz
libdnf: fix deprecation warning
Backport from libdnf. Fix is in version 0.35.2. Signed-off-by: Joe Slater <joe.slater@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/libdnf')
-rw-r--r--meta/recipes-devtools/libdnf/libdnf/fix-deprecation-warning.patch71
-rw-r--r--meta/recipes-devtools/libdnf/libdnf_0.28.1.bb1
2 files changed, 72 insertions, 0 deletions
diff --git a/meta/recipes-devtools/libdnf/libdnf/fix-deprecation-warning.patch b/meta/recipes-devtools/libdnf/libdnf/fix-deprecation-warning.patch
new file mode 100644
index 0000000000..3a3e02f352
--- /dev/null
+++ b/meta/recipes-devtools/libdnf/libdnf/fix-deprecation-warning.patch
@@ -0,0 +1,71 @@
+From 66d9b2ba3fbc7b04f2b5ad9d0e5371340c037b5f Mon Sep 17 00:00:00 2001
+From: Marek Blaha <mblaha@redhat.com>
+Date: Wed, 10 Jul 2019 10:11:01 +0200
+Subject: [oe-core][PATCH 1/1] Fix Python 3.8 deprecation warning
+ (RhBug:1724244)
+
+This deprecation warning was introduced in Python 3.8 by
+https://bugs.python.org/issue36381:
+
+/usr/lib/python3.8/site-packages/dnf/package.py:57: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
+ return super(Package, self).chksum
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1724244
+---
+ python/hawkey/package-py.cpp | 3 ++-
+ python/hawkey/packagedelta-py.cpp | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+---
+
+Unchanged. Appears in version 0.35.2.
+
+Upstream-Status: Backport [git://github.com/rpm-software-management/libdnf.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+diff --git a/python/hawkey/package-py.cpp b/python/hawkey/package-py.cpp
+index 5102bba..68e03cb 100644
+--- a/python/hawkey/package-py.cpp
++++ b/python/hawkey/package-py.cpp
+@@ -18,6 +18,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#define PY_SSIZE_T_CLEAN
+ #include <Python.h>
+ #include <stdio.h>
+
+@@ -251,7 +252,7 @@ get_chksum(_PackageObject *self, void *closure)
+ #if PY_MAJOR_VERSION < 3
+ res = Py_BuildValue("is#", type, cs, checksum_length);
+ #else
+- res = Py_BuildValue("iy#", type, cs, checksum_length);
++ res = Py_BuildValue("iy#", type, cs, (Py_ssize_t)checksum_length);
+ #endif
+
+ return res;
+diff --git a/python/hawkey/packagedelta-py.cpp b/python/hawkey/packagedelta-py.cpp
+index ca1cb7d..1a64836 100644
+--- a/python/hawkey/packagedelta-py.cpp
++++ b/python/hawkey/packagedelta-py.cpp
+@@ -18,6 +18,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#define PY_SSIZE_T_CLEAN
+ #include <Python.h>
+
+ // hawkey
+@@ -92,7 +93,7 @@ get_chksum(_PackageDeltaObject *self, void *closure)
+ #if PY_MAJOR_VERSION < 3
+ res = Py_BuildValue("is#", type, cs, checksum_length);
+ #else
+- res = Py_BuildValue("iy#", type, cs, checksum_length);
++ res = Py_BuildValue("iy#", type, cs, (Py_ssize_t)checksum_length);
+ #endif
+
+ return res;
+--
+2.7.4
+
diff --git a/meta/recipes-devtools/libdnf/libdnf_0.28.1.bb b/meta/recipes-devtools/libdnf/libdnf_0.28.1.bb
index d498347094..163a2eec26 100644
--- a/meta/recipes-devtools/libdnf/libdnf_0.28.1.bb
+++ b/meta/recipes-devtools/libdnf/libdnf_0.28.1.bb
@@ -8,6 +8,7 @@ SRC_URI = "git://github.com/rpm-software-management/libdnf \
file://0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch \
file://0001-Add-WITH_TESTS-option.patch \
file://0001-include-stdexcept-for-runtime_error.patch \
+ file://fix-deprecation-warning.patch \
"
SRCREV = "751f89045b80d58c0d05800f74357cf78cdf7e77"