mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
devtool: update-recipe: get srcuri parameters with decodeurl()
Use already existing bb.fetch.decodeurl() for getting the parameters for a URI. This is more fault tolerant and maintainable. (From OE-Core rev: cd201664b827e37fcabca272262016b171e997d9) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
9cda8f782f
commit
06cde90f9f
@@ -761,11 +761,8 @@ def _guess_recipe_update_mode(srctree, rdata):
|
|||||||
# Just use the first URI for now
|
# Just use the first URI for now
|
||||||
uri = git_uris[0]
|
uri = git_uris[0]
|
||||||
# Check remote branch
|
# Check remote branch
|
||||||
upstr_branch = 'master'
|
params = bb.fetch.decodeurl(uri)[5]
|
||||||
for paramdef in uri.split(';')[1:]:
|
upstr_branch = params['branch'] if 'branch' in params else 'master'
|
||||||
name, value = paramdef.split('=', 1)
|
|
||||||
if name == 'branch':
|
|
||||||
upstr_branch = value
|
|
||||||
# Check if current branch HEAD is found in upstream branch
|
# Check if current branch HEAD is found in upstream branch
|
||||||
stdout, _ = bb.process.run('git rev-parse HEAD', cwd=srctree)
|
stdout, _ = bb.process.run('git rev-parse HEAD', cwd=srctree)
|
||||||
head_rev = stdout.rstrip()
|
head_rev = stdout.rstrip()
|
||||||
|
|||||||
Reference in New Issue
Block a user