diff mbox series

dnf: backport a patch to fix execution under Python 3.7

Message ID 20181115124923.32661-1-ross.burton@intel.com
State New
Headers show
Series dnf: backport a patch to fix execution under Python 3.7 | expand

Commit Message

Ross Burton Nov. 15, 2018, 12:49 p.m. UTC
Python 3.7 removed the os.errno import, so fix dnf to use the correct import.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/recipes-devtools/dnf/dnf/errno.patch | 36 +++++++++++++++++++++++++++++++
 meta/recipes-devtools/dnf/dnf_2.7.5.bb    |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 meta/recipes-devtools/dnf/dnf/errno.patch

-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/recipes-devtools/dnf/dnf/errno.patch b/meta/recipes-devtools/dnf/dnf/errno.patch
new file mode 100644
index 00000000000..76a1690b765
--- /dev/null
+++ b/meta/recipes-devtools/dnf/dnf/errno.patch
@@ -0,0 +1,36 @@ 
+Don't use os.errno as that should never have existed, and doesn't exist with
+Python 3.7.
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 199fc9cb11ff004fc752b58b7177aaf8d7fcedfd Mon Sep 17 00:00:00 2001
+From: Neal Gompa <ngompa13@gmail.com>
+Date: Sat, 3 Mar 2018 12:44:54 -0500
+Subject: [PATCH] util: Correctly source errno.EEXIST
+
+---
+ dnf/util.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/dnf/util.py b/dnf/util.py
+index ab7fd279c..d0f1a4f25 100644
+--- a/dnf/util.py
++++ b/dnf/util.py
+@@ -28,6 +28,7 @@
+ import dnf
+ import dnf.const
+ import dnf.pycomp
++import errno
+ import itertools
+ import librepo
+ import locale
+@@ -120,7 +121,7 @@ def ensure_dir(dname):
+     try:
+         os.makedirs(dname, mode=0o755)
+     except OSError as e:
+-        if e.errno != os.errno.EEXIST or not os.path.isdir(dname):
++        if e.errno != errno.EEXIST or not os.path.isdir(dname):
+             raise e
+ 
+ def empty(iterable):
\ No newline at end of file
diff --git a/meta/recipes-devtools/dnf/dnf_2.7.5.bb b/meta/recipes-devtools/dnf/dnf_2.7.5.bb
index df60d731b69..e2754fbb932 100644
--- a/meta/recipes-devtools/dnf/dnf_2.7.5.bb
+++ b/meta/recipes-devtools/dnf/dnf_2.7.5.bb
@@ -10,6 +10,7 @@  SRC_URI = "git://github.com/rpm-software-management/dnf.git \
            file://0005-Do-not-prepend-installroot-to-logdir.patch \
            file://0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
            file://0030-Run-python-scripts-using-env.patch \
+           file://errno.patch \
            "
 
 SRCREV = "564c44667c7014843fa6f1732621093114ec59b2"