summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bblayers/query.py
diff options
context:
space:
mode:
authorJoerg Schmidt <joerg.schmidt@garmin.com>2025-02-20 08:35:59 -0700
committerSteve Sakoman <steve@sakoman.com>2025-02-21 06:34:58 -0800
commit4355f1479375ccd432dfaf75d091c0af3ea08066 (patch)
tree1ead4b4ef489b39a46c70cffab75dfb4c850b8c8 /bitbake/lib/bblayers/query.py
parent1cbcbab0555c8005b66dc31d2567bb9b3469d237 (diff)
downloadpoky-4355f1479375ccd432dfaf75d091c0af3ea08066.tar.gz
bitbake: bblayers/query: Fix using "removeprefix" string method
The minimum Python version required for Yocto 5.0 is 3.8 which causes failure in poky/bitbake/lib/bblayers/query.py when listing layers by using command "bitbake-layers show-recipes -f --bare --mc MC" for the given multiconfig MC. The reason for that failure is the use of "removeprefix" string method which got introduced in Python 3.9. This patch replaces the "removeprefix" method with an equivalent solution supported by Python 3.8. (Bitbake rev: 58e5c70a0572ff5994dc181694e05cd5d3ddaf66) Signed-off-by: Joerg Schmidt <joerg.schmidt@garmin.com> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'bitbake/lib/bblayers/query.py')
-rw-r--r--bitbake/lib/bblayers/query.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bitbake/lib/bblayers/query.py b/bitbake/lib/bblayers/query.py
index eb7cb465b4..9b2e081cfd 100644
--- a/bitbake/lib/bblayers/query.py
+++ b/bitbake/lib/bblayers/query.py
@@ -145,7 +145,8 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
145 skiplist = list(self.tinfoil.cooker.skiplist_by_mc[mc].keys()) 145 skiplist = list(self.tinfoil.cooker.skiplist_by_mc[mc].keys())
146 146
147 if mc: 147 if mc:
148 skiplist = [s.removeprefix(f'mc:{mc}:') for s in skiplist] 148 mcspec = f'mc:{mc}:'
149 skiplist = [s[len(mcspec):] if s.startswith(mcspec) else s for s in skiplist]
149 150
150 for fn in skiplist: 151 for fn in skiplist:
151 recipe_parts = os.path.splitext(os.path.basename(fn))[0].split('_') 152 recipe_parts = os.path.splitext(os.path.basename(fn))[0].split('_')