From 9d41e993a95a7b60f1ed5f8e9ca887fdf393233c Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Tue, 22 Dec 2015 17:02:55 +1300 Subject: recipetool: create: handle https://....git URLs When you grab a URL for a github repository you'll almost certainly find it in https://github.com/path/to/repository.git format; but bitbake's fetcher can't handle that because it'll see https:// at the start and assume it should use wget to fetch it. If the URL starts with http:// or https:// and the path part ends with .git then assume it's a git repository and adjust it accordingly. (From OE-Core master rev: bdbc4cf41d30eddb8a9ed882dedcc1670ce8fdd6) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- scripts/lib/recipetool/create.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts') diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 15aa9bdbb3..e2941d7753 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py @@ -108,6 +108,11 @@ def create_recipe(args): # Assume the archive contains the directory structure verbatim # so we need to extract to a subdirectory fetchuri += ';subdir=%s' % os.path.splitext(os.path.basename(urlparse.urlsplit(fetchuri).path))[0] + git_re = re.compile('(https?)://([^;]+\.git)(;.*)?') + res = git_re.match(fetchuri) + if res: + # Need to switch the URI around so that the git fetcher is used + fetchuri = 'git://%s;protocol=%s%s' % (res.group(2), res.group(1), res.group(3) or '') srcuri = fetchuri rev_re = re.compile(';rev=([^;]+)') res = rev_re.search(srcuri) -- cgit 1.2.3-korg