diff options
author | He Zhe <zhe.he@windriver.com> | 2020-02-22 11:37:24 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-04 23:17:38 +0100 |
commit | f6998f7c70305b650316a8586bb39d94fab00326 (patch) | |
tree | 18c3cbcb235f2efedda2ad3fc7411bebe6c0e1ed | |
parent | 92f184e213040517280991e22a84a2c5fc19149d (diff) | |
download | poky-f6998f7c70305b650316a8586bb39d94fab00326.tar.gz poky-f6998f7c70305b650316a8586bb39d94fab00326.tar.bz2 poky-f6998f7c70305b650316a8586bb39d94fab00326.zip |
perf: Correct the substitution of python shebangs
To make the native python3 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>
(From OE-Core rev: 3f93173130a94310255389cfc62c67102a4fb21b)
(From OE-Core rev: c0bcc24ccc6d769935d7fa202a1405250d94e342)
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 3a1a18ba9d28adb5562eabe9ec354f6d93154f5c)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-kernel/perf/perf.bb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb index d707b580e2..904aca95de 100644 --- a/meta/recipes-kernel/perf/perf.bb +++ b/meta/recipes-kernel/perf/perf.bb @@ -233,11 +233,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'` `find ${S}/scripts/ -name '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 |