]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
fetch/git: Change to use clearer ssh url syntax for broken servers
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 7 Jan 2016 13:18:52 +0000 (13:18 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 7 Jan 2016 13:53:04 +0000 (13:53 +0000)
Some servers, e.g. bitbucket.org can't cope with ssh:// as part of
the git url syntax. git itself is happy enough with this but you
get server side errors when using it.

This changes the git fetcher to use the more common ssh url format
which also means we need a : before the path.

Seems a shame to have to do this due to broken servers however
it should be safe enough since this other form is the one most people
use on the commandline so it should be safe enough.

[YOCTO #8864]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/fetch2/git.py

index 5ffab220569a51335d58cd88e2963e4ead085004..10ba1d3a6105fcafc67d56c0701a38750a1f9c9c 100644 (file)
@@ -330,6 +330,10 @@ class Git(FetchMethod):
             username = ud.user + '@'
         else:
             username = ""
+        if ud.proto == "ssh":
+            # Some servers, e.g. bitbucket.org can't cope with ssh://
+            # and removing that means we need a : before path.
+            return "%s%s:%s" % (username, ud.host, ud.path)
         return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path)
 
     def _revision_key(self, ud, d, name):