[meta-oe] mcelog: fix compile error

Message ID 20220401024251.6248-1-kai.kang@windriver.com
State Under Review
Headers show
Series [meta-oe] mcelog: fix compile error | expand

Commit Message

Kai April 1, 2022, 2:42 a.m. UTC
From: Kai Kang <kai.kang@windriver.com>

Fix compile error of mcelog if no /usr/bin/python exists on build
machine. And adjust indent as well.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 .../0001-genconfig.py-update-shebang.patch    | 33 +++++++++++++++++++
 meta-oe/recipes-support/mcelog/mcelog_180.bb  |  4 ++-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/mcelog/mcelog/0001-genconfig.py-update-shebang.patch

Patch

diff --git a/meta-oe/recipes-support/mcelog/mcelog/0001-genconfig.py-update-shebang.patch b/meta-oe/recipes-support/mcelog/mcelog/0001-genconfig.py-update-shebang.patch
new file mode 100644
index 000000000..10d17f57d
--- /dev/null
+++ b/meta-oe/recipes-support/mcelog/mcelog/0001-genconfig.py-update-shebang.patch
@@ -0,0 +1,33 @@ 
+From b09ff147e9383d33e6adbcb356b52236610fceda Mon Sep 17 00:00:00 2001
+From: Kai Kang <kai.kang@windriver.com>
+Date: Fri, 1 Apr 2022 10:00:00 +0800
+Subject: [PATCH] genconfig.py: update shebang
+
+It fails to call genconfig.py if no /usr/bin/python on build machine:
+
+| ./genconfig.py mcelog.conf config-intro.man > mcelog.conf.5
+| /bin/sh: ./genconfig.py: /usr/bin/python: bad interpreter: No such file or directory
+| Makefile:71: recipe for target 'mcelog.conf.5' failed
+
+Update shebang with 'env python3' instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ genconfig.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/genconfig.py b/genconfig.py
+index ce9987f..982cac6 100755
+--- a/genconfig.py
++++ b/genconfig.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python3
+ # generate man config documentation from mcelog.conf example
+ # genconfig.py mcelog.conf intro.html
+ from __future__ import print_function
+-- 
+2.17.1
+
diff --git a/meta-oe/recipes-support/mcelog/mcelog_180.bb b/meta-oe/recipes-support/mcelog/mcelog_180.bb
index 249e2421c..a64aacabf 100644
--- a/meta-oe/recipes-support/mcelog/mcelog_180.bb
+++ b/meta-oe/recipes-support/mcelog/mcelog_180.bb
@@ -5,8 +5,10 @@  and should run on all Linux systems that need error handling."
 HOMEPAGE = "https://mcelog.org/"
 SECTION = "System Environment/Base"
 
-SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git;protocol=http;;branch=master \
+SRC_URI = "\
+    git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git;protocol=http;;branch=master \
     file://run-ptest \
+    file://0001-genconfig.py-update-shebang.patch \
 "
 
 SRCREV = "4146c9296a0cbd26f1c5e411cb44877f350053bd"