summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/fetch2/gitsm.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
index b7959ff5d1..dd94186cc4 100644
--- a/bitbake/lib/bb/fetch2/gitsm.py
+++ b/bitbake/lib/bb/fetch2/gitsm.py
@@ -100,8 +100,21 @@ class GitSM(Git):
100 module_hash = module_hash.split()[2] 100 module_hash = module_hash.split()[2]
101 101
102 # Build new SRC_URI 102 # Build new SRC_URI
103 proto = uris[module].split(':', 1)[0] 103 if "://" not in uris[module]:
104 url = uris[module].replace('%s:' % proto, 'gitsm:', 1) 104 # It's ssh if the format does NOT have "://", but has a ':'
105 if ":" in uris[module]:
106 proto = "ssh"
107 if ":/" in uris[module]:
108 url = "gitsm://" + uris[module].replace(':/', '/', 1)
109 else:
110 url = "gitsm://" + uris[module].replace(':', '/', 1)
111 else: # Fall back to 'file' if there is no ':'
112 proto = "file"
113 url = "gitsm://" + uris[module]
114 else:
115 proto = uris[module].split(':', 1)[0]
116 url = uris[module].replace('%s:' % proto, 'gitsm:', 1)
117
105 url += ';protocol=%s' % proto 118 url += ';protocol=%s' % proto
106 url += ";name=%s" % module 119 url += ";name=%s" % module
107 url += ";bareclone=1;nocheckout=1;nobranch=1" 120 url += ";bareclone=1;nocheckout=1;nobranch=1"