From 5de850ec0148e576a4f1e5cdfa813d65a5016b86 Mon Sep 17 00:00:00 2001 From: Johannes Schneider Date: Wed, 5 Nov 2025 20:06:34 +0100 Subject: [PATCH] bitbake: bitbake-setup: checkout_layers: construct 'src_uri' separatly Construct the 'src_uri' separately, and then pass either variant into one call that creates the Fetch. Making use of format-strings to shorten/simplify the code. Also: using 'proto' instead of 'type' for a variable name, to avoid the protected keyword. (Bitbake rev: 4ad70e05ceca19c1e903dafc33386a82b1176bba) Signed-off-by: Johannes Schneider Signed-off-by: Richard Purdie --- bitbake/bin/bitbake-setup | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bitbake/bin/bitbake-setup b/bitbake/bin/bitbake-setup index 59b4dfdb8e..ff753557ce 100755 --- a/bitbake/bin/bitbake-setup +++ b/bitbake/bin/bitbake-setup @@ -90,13 +90,14 @@ def checkout_layers(layers, layerdir, d): remotes = r_remote['remotes'] for remote in remotes: - type,host,path,user,pswd,params = bb.fetch.decodeurl(remotes[remote]["uri"]) + prot,host,path,user,pswd,params = bb.fetch.decodeurl(remotes[remote]["uri"]) fetchuri = bb.fetch.encodeurl(('git',host,path,user,pswd,params)) print(" {}".format(r_name)) if branch: - fetcher = bb.fetch.Fetch(["{};protocol={};rev={};branch={};destsuffix={}".format(fetchuri,type,rev,branch,repodir)], d) + src_uri = f"{fetchuri};protocol={prot};rev={rev};branch={branch};destsuffix={repodir}" else: - fetcher = bb.fetch.Fetch(["{};protocol={};rev={};nobranch=1;destsuffix={}".format(fetchuri,type,rev,repodir)], d) + src_uri = f"{fetchuri};protocol={prot};rev={rev};nobranch=1;destsuffix={repodir}" + fetcher = bb.fetch.Fetch([src_uri], d) do_fetch(fetcher, layerdir) if os.path.exists(os.path.join(layerdir, repodir, 'scripts/oe-setup-build')):