Skip to contentSkip to conversation

mcelog: fix compile error

PATCH New [email protected] 1 participant 1 message Apr 1, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mcelog: fix compile error

From: Kai Kang <[email protected]>

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

---
 .../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
meta-oe/recipes-support/mcelog/mcelog/0001-genconfig.py-update-shebang.patch new file +33 -0
new file mode 100644
index 000000000..10d17f57d
@@ -0,0 +1,33 @@
+From b09ff147e9383d33e6adbcb356b52236610fceda Mon Sep 17 00:00:00 2001
+From: Kai Kang <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta-oe/recipes-support/mcelog/mcelog_180.bb +3 -1
index 249e2421c..a64aacabf 100644
@@ -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"
Signature · 1 line
2.17.1