diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-02-11 14:13:34 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-11 12:33:03 +0000 |
commit | ca5a36cbd16ad497edcceb74ff44c718f73aa218 (patch) | |
tree | 70dff5adfe19112880958c207bfad71b810cc2c6 /scripts/lib/recipetool/create.py | |
parent | 4c71afb3784e4ff9656f909af2f11def9b725f55 (diff) | |
download | poky-ca5a36cbd16ad497edcceb74ff44c718f73aa218.tar.gz |
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.
(From OE-Core rev: 3ca04757a670e8b6f78799cc0454d75691809ac4)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/recipetool/create.py')
-rw-r--r-- | scripts/lib/recipetool/create.py | 10 |
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): | |||
291 | 291 | ||
292 | def reformat_git_uri(uri): | 292 | def reformat_git_uri(uri): |
293 | '''Convert any http[s]://....git URI into git://...;protocol=http[s]''' | 293 | '''Convert any http[s]://....git URI into git://...;protocol=http[s]''' |
294 | res = re.match('(https?)://([^;]+\.git)(;.*)?$', uri) | 294 | checkuri = uri.split(';', 1)[0] |
295 | if res: | 295 | if checkuri.endswith('.git') or '/git/' in checkuri: |
296 | # Need to switch the URI around so that the git fetcher is used | 296 | res = re.match('(https?)://([^;]+(\.git)?)(;.*)?$', uri) |
297 | return 'git://%s;protocol=%s%s' % (res.group(2), res.group(1), res.group(3) or '') | 297 | if res: |
298 | # Need to switch the URI around so that the git fetcher is used | ||
299 | return 'git://%s;protocol=%s%s' % (res.group(2), res.group(1), res.group(4) or '') | ||
298 | return uri | 300 | return uri |
299 | 301 | ||
300 | def create_recipe(args): | 302 | def create_recipe(args): |