From: George Refseth <[email protected]>

When git referenced crate dependency dependens on (root) workspace virtual
manifest, when patching path the path to the folder containing the crate
within the referenced repo need to be added to the patching process.
A subdir argument is added to address this need.

Example usage when repo contains an api crate defining the api for org/repo:
SRC_URI:append = 
"git://[email protected]/<org>/<repo>.git;name=api;destsuffix=repo-api;subdir=crates/api;type=git-dependency"

Cc: Erik Wierich <[email protected]>
Signed-off-by: George Refseth <[email protected]>
---
 meta/classes-recipe/cargo_common.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes-recipe/cargo_common.bbclass 
b/meta/classes-recipe/cargo_common.bbclass
index 0d3edfe4a7..c1fe6a24ed 100644
--- a/meta/classes-recipe/cargo_common.bbclass
+++ b/meta/classes-recipe/cargo_common.bbclass
@@ -154,6 +154,9 @@ python cargo_common_do_patch_paths() {
                     repo = '%s://%s@%s%s' % (ud.proto, ud.user, ud.host, 
ud.path)
                 else:
                     repo = '%s://%s%s' % (ud.proto, ud.host, ud.path)
+                subdir = ud.parm.get('subdir')
+                if subdir is not None:
+                    destsuffix = os.path.join(destsuffix, subdir)
                 path = '%s = { path = "%s" }' % (name, os.path.join(workdir, 
destsuffix))
                 patches.setdefault(repo, []).append(path)
 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#237244): 
https://lists.openembedded.org/g/openembedded-core/message/237244
Mute This Topic: https://lists.openembedded.org/mt/119372311/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to