[yocto] [meta-security][PATCH] python3-fail2ban: Fix build error of xrange.

Lei Maohui leimaohui at cn.fujitsu.com
Wed May 8 23:29:08 PDT 2019


NameError: name 'xrange' is not defined

Signed-off-by: Lei Maohui <leimaohui at cn.fujitsu.com>
---
 .../files/0001-To-fix-build-error-of-xrang.patch   | 28 ++++++++++++++++++++++
 .../fail2ban/python3-fail2ban_0.10.4.0.bb          |  4 ++++
 2 files changed, 32 insertions(+)
 create mode 100644 recipes-security/fail2ban/files/0001-To-fix-build-error-of-xrang.patch

diff --git a/recipes-security/fail2ban/files/0001-To-fix-build-error-of-xrang.patch b/recipes-security/fail2ban/files/0001-To-fix-build-error-of-xrang.patch
new file mode 100644
index 0000000..7f0812c
--- /dev/null
+++ b/recipes-security/fail2ban/files/0001-To-fix-build-error-of-xrang.patch
@@ -0,0 +1,28 @@
+From fe3436d65518099d35c643848cba50253abc249c Mon Sep 17 00:00:00 2001
+From: Lei Maohui <leimaohui at cn.fujitsu.com>
+Date: Thu, 9 May 2019 14:44:51 +0900
+Subject: [PATCH] To fix build error of xrange.
+
+NameError: name 'xrange' is not defined
+
+Signed-off-by: Lei Maohui <leimaohui at cn.fujitsu.com>
+---
+ fail2ban/__init__.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fail2ban/__init__.py b/fail2ban/__init__.py
+index fa6dcf7..61789a4 100644
+--- a/fail2ban/__init__.py
++++ b/fail2ban/__init__.py
+@@ -82,7 +82,7 @@ strptime("2012", "%Y")
+ 
+ # short names for pure numeric log-level ("Level 25" could be truncated by short formats):
+ def _init():
+-	for i in xrange(50):
++	for i in range(50):
+ 		if logging.getLevelName(i).startswith('Level'):
+ 			logging.addLevelName(i, '#%02d-Lev.' % i)
+ _init()
+-- 
+2.7.4
+
diff --git a/recipes-security/fail2ban/python3-fail2ban_0.10.4.0.bb b/recipes-security/fail2ban/python3-fail2ban_0.10.4.0.bb
index 5c887e8..23ef027 100644
--- a/recipes-security/fail2ban/python3-fail2ban_0.10.4.0.bb
+++ b/recipes-security/fail2ban/python3-fail2ban_0.10.4.0.bb
@@ -2,3 +2,7 @@ inherit setuptools3
 require python-fail2ban.inc
 
 RDEPENDS_${PN}-ptest = "python3-core python3-io python3-modules python3-fail2ban"
+
+SRC_URI += " \
+        file://0001-To-fix-build-error-of-xrang.patch \
+"
-- 
2.7.4





More information about the yocto mailing list