All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] perf: Correct the substitution of python shebangs
@ 2020-02-14  3:57 zhe.he
  2020-02-14  4:33 ` Chen, Qi
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: zhe.he @ 2020-02-14  3:57 UTC (permalink / raw)
  To: openembedded-core

From: He Zhe <zhe.he@windriver.com>

To make the native python3 is always used,

- Use sed one-liner instead
- Add substitution for ${S}/scripts/bpf_helpers_doc.py to fix the
  following warning.

File "/usr/lib/python3.6/sysconfig.py", line 421, in _init_posix
_temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
ModuleNotFoundError: No module named '_sysconfigdata'

This issue is first reported by Joel Stanley <joel@jms.id.au>
The sed one-liner is credited to Anuj Mittal <anuj.mittal@intel.com>

Signed-off-by: He Zhe <zhe.he@windriver.com>
---
 meta/recipes-kernel/perf/perf.bb | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 6d1b06693d..a6fb51d3db 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -239,11 +239,8 @@ do_configure_prepend () {
     fi
 
     # use /usr/bin/env instead of version specific python
-    for s in `find ${S}/tools/perf/ -name '*.py'`; do
-        sed -i 's,/usr/bin/python,/usr/bin/env python3,' "${s}"
-        sed -i 's,/usr/bin/python2,/usr/bin/env python3,' "${s}"
-        sed -i 's,/usr/bin/env python2,/usr/bin/env python3,' "${s}"
-        sed -i 's,/usr/bin/python3,/usr/bin/env python3,' "${s}"
+    for s in `find ${S}/tools/perf/ -name '*.py'` ${S}/scripts/bpf_helpers_doc.py; do
+        sed -i -e "s,#!.*python.*,#!${USRBINPATH}/env python3," ${s}
     done
 
     # unistd.h can be out of sync between libc-headers and the captured version in the perf source
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-02-21 22:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-14  3:57 [PATCH v3] perf: Correct the substitution of python shebangs zhe.he
2020-02-14  4:33 ` Chen, Qi
2020-02-14 13:18 ` Bruce Ashfield
2020-02-14 18:09   ` Richard Purdie
2020-02-21 21:43 ` Joshua Watt
2020-02-21 22:15   ` Khem Raj
2020-02-21 22:23     ` Bruce Ashfield
2020-02-21 22:30       ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.