cargo_common.bbclass: add support of user in url for patch

To handle url like git://git@repo/project

(From OE-Core rev: ad99ede096aff03c974b8725d90d3c9d1056bae0)

Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Frederic Martinsons
2023-03-31 07:45:23 +02:00
committed by Richard Purdie
parent 0d099fa404
commit ddf65370a9

View File

@@ -134,7 +134,10 @@ python cargo_common_do_patch_paths() {
name = ud.parm.get('name')
destsuffix = ud.parm.get('destsuffix')
if name is not None and destsuffix is not None:
repo = '%s://%s%s' % (ud.proto, ud.host, ud.path)
if ud.user:
repo = '%s://%s@%s%s' % (ud.proto, ud.user, ud.host, ud.path)
else:
repo = '%s://%s%s' % (ud.proto, ud.host, ud.path)
path = '%s = { path = "%s" }' % (name, os.path.join(workdir, destsuffix))
patches.setdefault(repo, []).append(path)