kernel-devsrc: fix incorrect python shebang replacement

Update the sed replacement rule to strictly match '/usr/bin/python'
(with no trailing characters)

The previous sed rule was too broad and could incorrectly change Python
shebangs such as in
/lib/modules/6.16.11-yocto-standard/build/scripts/macro_checker.py from
'#!/usr/bin/python3' to '#!/usr/bin/env python33'.

(From OE-Core rev: c548259dbf55f2194088e62ad018560286834e49)

Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jiaying Song
2025-10-28 18:18:07 +08:00
committed by Richard Purdie
parent 351f7f3b4c
commit 2f5d21049f

View File

@@ -400,7 +400,7 @@ do_install() {
for ss in $(find $kerneldir/build/scripts -type f -name '*'); do
sed -i 's,/usr/bin/python2,/usr/bin/env python3,' "$ss"
sed -i 's,/usr/bin/env python2,/usr/bin/env python3,' "$ss"
sed -i 's,/usr/bin/python,/usr/bin/env python3,' "$ss"
sed -i 's,/usr/bin/python$,/usr/bin/env python3,' "$ss"
done
chown -R root:root ${D}