[oe-commits] [openembedded-core] 02/03: perf: Correct the substitution of python shebangs

git at git.openembedded.org git at git.openembedded.org
Sat Feb 22 15:03:31 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 3da604a0256d8f36916d1a12938be374fd272a8b
Author: He Zhe <zhe.he at windriver.com>
AuthorDate: Sat Feb 22 11:37:24 2020 +0800

    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 at jms.id.au>
    The sed one-liner is credited to Anuj Mittal <anuj.mittal at intel.com>
    
    Signed-off-by: He Zhe <zhe.he at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 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 6d1b066..10a5b88 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'` `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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list