summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/bitbake-setup
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/bin/bitbake-setup')
-rwxr-xr-xbitbake/bin/bitbake-setup12
1 files changed, 10 insertions, 2 deletions
diff --git a/bitbake/bin/bitbake-setup b/bitbake/bin/bitbake-setup
index ce5cd5e65f..8ceacada9a 100755
--- a/bitbake/bin/bitbake-setup
+++ b/bitbake/bin/bitbake-setup
@@ -86,13 +86,17 @@ def checkout_layers(layers, layerdir, d):
86 86
87 r_remote = r_data['git-remote'] 87 r_remote = r_data['git-remote']
88 rev = r_remote['rev'] 88 rev = r_remote['rev']
89 branch = r_remote.get('branch', None)
89 remotes = r_remote['remotes'] 90 remotes = r_remote['remotes']
90 91
91 for remote in remotes: 92 for remote in remotes:
92 type,host,path,user,pswd,params = bb.fetch.decodeurl(remotes[remote]["uri"]) 93 type,host,path,user,pswd,params = bb.fetch.decodeurl(remotes[remote]["uri"])
93 fetchuri = bb.fetch.encodeurl(('git',host,path,user,pswd,params)) 94 fetchuri = bb.fetch.encodeurl(('git',host,path,user,pswd,params))
94 print(" {}".format(r_name)) 95 print(" {}".format(r_name))
95 fetcher = bb.fetch.Fetch(["{};protocol={};rev={};nobranch=1;destsuffix={}".format(fetchuri,type,rev,repodir)], d) 96 if branch:
97 fetcher = bb.fetch.Fetch(["{};protocol={};rev={};branch={};destsuffix={}".format(fetchuri,type,rev,branch,repodir)], d)
98 else:
99 fetcher = bb.fetch.Fetch(["{};protocol={};rev={};nobranch=1;destsuffix={}".format(fetchuri,type,rev,repodir)], d)
96 do_fetch(fetcher, layerdir) 100 do_fetch(fetcher, layerdir)
97 101
98 if os.path.exists(os.path.join(layerdir, repodir, 'scripts/oe-setup-build')): 102 if os.path.exists(os.path.join(layerdir, repodir, 'scripts/oe-setup-build')):
@@ -444,12 +448,16 @@ def are_layers_changed(layers, layerdir, d):
444 448
445 r_remote = r_data['git-remote'] 449 r_remote = r_data['git-remote']
446 rev = r_remote['rev'] 450 rev = r_remote['rev']
451 branch = r_remote.get('branch', None)
447 remotes = r_remote['remotes'] 452 remotes = r_remote['remotes']
448 453
449 for remote in remotes: 454 for remote in remotes:
450 type,host,path,user,pswd,params = bb.fetch.decodeurl(remotes[remote]["uri"]) 455 type,host,path,user,pswd,params = bb.fetch.decodeurl(remotes[remote]["uri"])
451 fetchuri = bb.fetch.encodeurl(('git',host,path,user,pswd,params)) 456 fetchuri = bb.fetch.encodeurl(('git',host,path,user,pswd,params))
452 fetcher = bb.fetch.FetchData("{};protocol={};rev={};nobranch=1;destsuffix={}".format(fetchuri,type,rev,repodir), d) 457 if branch:
458 fetcher = bb.fetch.FetchData("{};protocol={};rev={};branch={};destsuffix={}".format(fetchuri,type,rev,branch,repodir), d)
459 else:
460 fetcher = bb.fetch.FetchData("{};protocol={};rev={};nobranch=1;destsuffix={}".format(fetchuri,type,rev,repodir), d)
453 upstream_revision = fetcher.method.latest_revision(fetcher, d, 'default') 461 upstream_revision = fetcher.method.latest_revision(fetcher, d, 'default')
454 rev_parse_result = bb.process.run('git -C {} rev-parse HEAD'.format(os.path.join(layerdir, repodir))) 462 rev_parse_result = bb.process.run('git -C {} rev-parse HEAD'.format(os.path.join(layerdir, repodir)))
455 local_revision = rev_parse_result[0].strip() 463 local_revision = rev_parse_result[0].strip()