git.py: Handle space in git repo name
Signed-off-by Ankur Tyagi <[email protected]>
--- lib/bb/fetch2/git.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/bb/fetch2/git.py +3 -3
@@ -236,7 +236,7 @@ class Git(FetchMethod): ud.unresolvedrev[name] = ud.revisions[name] ud.revisions[name] = self.latest_revision(ud, d, name) - gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.')) + gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.').replace(" ", "%20")) if gitsrcname.startswith('.'): gitsrcname = gitsrcname[1:]
@@ -459,7 +459,7 @@ class Git(FetchMethod): readpathspec = "" def_destsuffix = "git/" - destsuffix = ud.parm.get("destsuffix", def_destsuffix) + destsuffix = ud.parm.get("destsuffix", def_destsuffix).replace(" ", "%20") destdir = ud.destdir = os.path.join(destdir, destsuffix) if os.path.exists(destdir): bb.utils.prunedir(destdir)
@@ -574,7 +574,7 @@ class Git(FetchMethod): username = ud.user + '@' else: username = "" - return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path) + return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path.replace(" ", "%20")) def _revision_key(self, ud, d, name): """
Signature · 1 line
2.22.0.windows.1
Hi,
wouldn't this break the non-http protocols?
Regards
//Ernst
tis 2019-07-02 klockan 21:07 +1200 skrev Ankur Tyagi:
Quoted 47 lines
Signed-off-by: Ankur Tyagi <
[email protected]Quoted 1 line
--- lib/bb/fetch2/git.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)lib/bb/fetch2/git.py +1
-1@@ -236,7 +236,7 @@ class Git(FetchMethod): ud.unresolvedrev[name] = ud.revisions[name] ud.revisions[name] = self.latest_revision(ud, d, name) - gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.')) + gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.').replace(" ", "%20"))if
gitsrcname.startswith('.'):
gitsrcname = gitsrcname[1:]lib/bb/fetch2/git.py +1
-1@@ -459,7 +459,7 @@ class Git(FetchMethod): readpathspec = "" def_destsuffix = "git/" - destsuffix = ud.parm.get("destsuffix", def_destsuffix) + destsuffix = ud.parm.get("destsuffix", def_destsuffix).replace(" ", "%20") destdir = ud.destdir = os.path.join(destdir, destsuffix) if os.path.exists(destdir):
bb.utils.prunedir(destdir)lib/bb/fetch2/git.py +1
-1@@ -574,7 +574,7 @@ class Git(FetchMethod): username = ud.user + '@' else: username = "" - return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path) + return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path.replace(" ", "%20"))def
_revision_key(self, ud, d, name):
"""Signature · 1 line
2.22.0.windows.1