]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
yocto-bsp: Fix git url parsing, allowing for local mirrors
authorDarren Hart <dvhart@linux.intel.com>
Thu, 18 Oct 2012 14:23:23 +0000 (14:23 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 24 Oct 2012 11:48:24 +0000 (12:48 +0100)
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>
scripts/lib/bsp/kernel.py

index d4bdc4c2509018c8b2e10b5a525576cc3c4b0f0c..128fad0dfaa0d5874e2bff02ee806f53c5aa4983 100644 (file)
@@ -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):