diff options
| author | Johannes Schneider <johannes.schneider@leica-geosystems.com> | 2025-11-05 20:06:34 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-06 18:03:46 +0000 |
| commit | 5de850ec0148e576a4f1e5cdfa813d65a5016b86 (patch) | |
| tree | ec934fa4fc1a5a48723a8a7c6dca2902cdca4400 /bitbake | |
| parent | 729e6f2cfda4cb1aefc7c6d03b6f834138fb1ed8 (diff) | |
| download | poky-5de850ec0148e576a4f1e5cdfa813d65a5016b86.tar.gz | |
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 <johannes.schneider@leica-geosystems.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
| -rwxr-xr-x | bitbake/bin/bitbake-setup | 7 |
1 files 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): | |||
| 90 | remotes = r_remote['remotes'] | 90 | remotes = r_remote['remotes'] |
| 91 | 91 | ||
| 92 | for remote in remotes: | 92 | for remote in remotes: |
| 93 | type,host,path,user,pswd,params = bb.fetch.decodeurl(remotes[remote]["uri"]) | 93 | prot,host,path,user,pswd,params = bb.fetch.decodeurl(remotes[remote]["uri"]) |
| 94 | fetchuri = bb.fetch.encodeurl(('git',host,path,user,pswd,params)) | 94 | fetchuri = bb.fetch.encodeurl(('git',host,path,user,pswd,params)) |
| 95 | print(" {}".format(r_name)) | 95 | print(" {}".format(r_name)) |
| 96 | if branch: | 96 | if branch: |
| 97 | fetcher = bb.fetch.Fetch(["{};protocol={};rev={};branch={};destsuffix={}".format(fetchuri,type,rev,branch,repodir)], d) | 97 | src_uri = f"{fetchuri};protocol={prot};rev={rev};branch={branch};destsuffix={repodir}" |
| 98 | else: | 98 | else: |
| 99 | fetcher = bb.fetch.Fetch(["{};protocol={};rev={};nobranch=1;destsuffix={}".format(fetchuri,type,rev,repodir)], d) | 99 | src_uri = f"{fetchuri};protocol={prot};rev={rev};nobranch=1;destsuffix={repodir}" |
| 100 | fetcher = bb.fetch.Fetch([src_uri], d) | ||
| 100 | do_fetch(fetcher, layerdir) | 101 | do_fetch(fetcher, layerdir) |
| 101 | 102 | ||
| 102 | if os.path.exists(os.path.join(layerdir, repodir, 'scripts/oe-setup-build')): | 103 | if os.path.exists(os.path.join(layerdir, repodir, 'scripts/oe-setup-build')): |
