[oe-commits] Markus Lehtonen : devtool: update-recipe: get srcuri parameters with decodeurl()

git at git.openembedded.org git at git.openembedded.org
Sat Sep 12 21:51:43 UTC 2015


Module: openembedded-core.git
Branch: master
Commit: cd201664b827e37fcabca272262016b171e997d9
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=cd201664b827e37fcabca272262016b171e997d9

Author: Markus Lehtonen <markus.lehtonen at linux.intel.com>
Date:   Fri Sep 11 13:08:08 2015 +0300

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.

Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 scripts/lib/devtool/standard.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 5263af5..d5900b4 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -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()



More information about the Openembedded-commits mailing list