| Index: ensure_dependencies.py |
| diff --git a/ensure_dependencies.py b/ensure_dependencies.py |
| index d8af9e718b27d802acd7cde70301341220c6f7eb..82e01a093c02c8aa5efa1e18e789b92e36d221fb 100755 |
| --- a/ensure_dependencies.py |
| +++ b/ensure_dependencies.py |
| @@ -175,6 +175,12 @@ def get_repo_type(repo): |
| return name |
| return None |
| +def postprocess_url(url, type): |
| + # Handle alternative syntax of Git SSH URLS |
| + if (type == "git" and "@" in url and ":" in url and not urlparse.urlsplit(url).scheme): |
|
Sebastian Noack
2015/04/30 13:08:28
No explicit VCS switches please. We already have a
kzar
2015/04/30 13:27:12
Done.
|
| + return "ssh://" + url.replace(":", "/", 1) |
| + return url |
| + |
| def ensure_repo(parentrepo, target, roots, sourcename): |
| if os.path.exists(target): |
| return |
| @@ -187,10 +193,13 @@ def ensure_repo(parentrepo, target, roots, sourcename): |
| if type is None: |
| raise Exception("No valid source found to create %s" % target) |
| - if os.path.exists(roots[type]): |
| - url = os.path.join(roots[type], sourcename) |
| + root = postprocess_url(roots[type], type) |
| + sourcename = postprocess_url(sourcename, type) |
| + |
| + if os.path.exists(root): |
| + url = os.path.join(root, sourcename) |
| else: |
| - url = urlparse.urljoin(roots[type], sourcename) |
| + url = urlparse.urljoin(root, sourcename) |
| logging.info("Cloning repository %s into %s" % (url, target)) |
| repo_types[type].clone(url, target) |