From 952b879de5ffdb04a706fc4e2824696b25c4bf11 Mon Sep 17 00:00:00 2001 From: Darren Hart Date: Thu, 18 Oct 2012 14:23:23 +0000 Subject: yocto-bsp: Fix git url parsing, allowing for local mirrors The git URLs used in bitbake recipes are not compatible directly with git. In bitbake-speak, all git URLs start with git:// and the protocol is optionally specified in the SRC_URI. Local git mirrors are specified like so: git:///path/to/local/mirror.git;protocol=file The URL that git requires would be: file:///path/to/local/mirror.git Update the yocto-bsp kernel.py to make the necessary adjustment when parsing the SRC_URI to extract the git URL. (From meta-yocto rev: 30506f51cc95f0994cf54144295832e931d15f61) Signed-off-by: Darren Hart CC: Tom Zanussi CC: evadeflow@gmail.com Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- scripts/lib/bsp/kernel.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py index d4bdc4c250..128fad0dfa 100644 --- a/scripts/lib/bsp/kernel.py +++ b/scripts/lib/bsp/kernel.py @@ -631,6 +631,7 @@ def extract_giturl(file): Extract the git url of the kernel repo from the kernel recipe's SRC_URI. """ + url = None f = open(file, "r") lines = f.readlines() for line in lines: @@ -641,10 +642,15 @@ def extract_giturl(file): line = line[1:].strip() if line.startswith("\""): line = line[1:].strip() - fields = line.split(";") - if fields: - return fields[0] - return None + prot = "git" + for s in line.split(";"): + if s.startswith("git://"): + url = s + if s.startswith("protocol="): + prot = s.split("=")[1] + if url: + url = prot + url[3:] + return url def find_giturl(context): -- cgit v1.2.3-54-g00ecf