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 <dvhart@linux.intel.com> CC: Tom Zanussi <tom.zanussi@intel.com> CC: evadeflow@gmail.com Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
a3d5e9e6b7
commit
952b879de5
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue