summaryrefslogtreecommitdiff
path: root/scripts/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-02-11 14:13:34 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-11 12:32:56 +0000
commit3ca04757a670e8b6f78799cc0454d75691809ac4 (patch)
tree0605f8c4970e3582d09b0f7e6dd07d0901ff8ff1 /scripts/lib
parentd3c46b5d0abd56bcadd4f2f1ef985f13d67f605b (diff)
downloadopenembedded-core-3ca04757a670e8b6f78799cc0454d75691809ac4.tar.gz
openembedded-core-3ca04757a670e8b6f78799cc0454d75691809ac4.tar.bz2
openembedded-core-3ca04757a670e8b6f78799cc0454d75691809ac4.zip
recipetool: create: convert http git URLs that don't end in .git but contain /git/
When recipetool create is given a URL that starts with http(s):// and contains /git/, such as the URLs at git.yoctoproject.org, it's fairly safe to assume it's a git repository and not something that should be fetched with wget, so rewrite the URL. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/recipetool/create.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index f6d75150bf..daf13fb50e 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -291,10 +291,12 @@ def supports_srcrev(uri):
def reformat_git_uri(uri):
'''Convert any http[s]://....git URI into git://...;protocol=http[s]'''
- res = re.match('(https?)://([^;]+\.git)(;.*)?$', uri)
- if res:
- # Need to switch the URI around so that the git fetcher is used
- return 'git://%s;protocol=%s%s' % (res.group(2), res.group(1), res.group(3) or '')
+ checkuri = uri.split(';', 1)[0]
+ if checkuri.endswith('.git') or '/git/' in checkuri:
+ res = re.match('(https?)://([^;]+(\.git)?)(;.*)?$', uri)
+ if res:
+ # Need to switch the URI around so that the git fetcher is used
+ return 'git://%s;protocol=%s%s' % (res.group(2), res.group(1), res.group(4) or '')
return uri
def create_recipe(args):