From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) by mail.openembedded.org (Postfix) with ESMTP id 263FE60FF1 for ; Fri, 14 Feb 2020 03:58:08 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id 01E3vm7K007352 (version=TLSv1 cipher=AES256-SHA bits=256 verify=FAIL) for ; Thu, 13 Feb 2020 19:57:59 -0800 Received: from pek-lpg-core3.wrs.com (128.224.153.232) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.468.0; Thu, 13 Feb 2020 19:57:38 -0800 From: To: Date: Fri, 14 Feb 2020 11:57:37 +0800 Message-ID: <20200214035737.9975-1-zhe.he@windriver.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [PATCH v3] perf: Correct the substitution of python shebangs X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Feb 2020 03:58:08 -0000 Content-Transfer-Encoding: 8bit Content-Type: text/plain From: He Zhe 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 The sed one-liner is credited to Anuj Mittal Signed-off-by: He Zhe --- 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