]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool: update-recipe: get srcuri parameters with decodeurl()
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 11 Sep 2015 10:08:08 +0000 (13:08 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 12 Sep 2015 21:47:24 +0000 (22:47 +0100)
Use already existing bb.fetch.decodeurl() for getting the parameters for
a URI. This is more fault tolerant and maintainable.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/standard.py

index 5263af56c856c1f4ed8397d9f6642ab12d3287ff..d5900b4f8279008f0b0a963ee3e0041a693544e8 100644 (file)
@@ -761,11 +761,8 @@ def _guess_recipe_update_mode(srctree, rdata):
     # Just use the first URI for now
     uri = git_uris[0]
     # Check remote branch
-    upstr_branch = 'master'
-    for paramdef in uri.split(';')[1:]:
-        name, value = paramdef.split('=', 1)
-        if name == 'branch':
-            upstr_branch = value
+    params = bb.fetch.decodeurl(uri)[5]
+    upstr_branch = params['branch'] if 'branch' in params else 'master'
     # Check if current branch HEAD is found in upstream branch
     stdout, _ = bb.process.run('git rev-parse HEAD', cwd=srctree)
     head_rev = stdout.rstrip()