module_hash = module_hash.split()[2]
# Build new SRC_URI
- proto = uris[module].split(':', 1)[0]
- url = uris[module].replace('%s:' % proto, 'gitsm:', 1)
+ if "://" not in uris[module]:
+ # It's ssh if the format does NOT have "://", but has a ':'
+ if ":" in uris[module]:
+ proto = "ssh"
+ if ":/" in uris[module]:
+ url = "gitsm://" + uris[module].replace(':/', '/', 1)
+ else:
+ url = "gitsm://" + uris[module].replace(':', '/', 1)
+ else: # Fall back to 'file' if there is no ':'
+ proto = "file"
+ url = "gitsm://" + uris[module]
+ else:
+ proto = uris[module].split(':', 1)[0]
+ url = uris[module].replace('%s:' % proto, 'gitsm:', 1)
+
url += ';protocol=%s' % proto
url += ";name=%s" % module
url += ";bareclone=1;nocheckout=1;nobranch=1"