From 0da3de16eb0516add084d1784ef84725c1d8fc00 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Fri, 20 Sep 2024 14:34:23 +0200 Subject: [PATCH] manifest: Add submodule representation in as_dict Submodules were missing when calling --freeze or --resolve Signed-off-by: Pieter De Gendt --- src/west/manifest.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/west/manifest.py b/src/west/manifest.py index 57041ef..500f348 100644 --- a/src/west/manifest.py +++ b/src/west/manifest.py @@ -882,6 +882,15 @@ class Project: _west_commands_maybe_delist(self.west_commands) if self.groups: ret['groups'] = self.groups + if isinstance(self.submodules, bool) and self.submodules: + ret['submodules'] = True + elif isinstance(self.submodules, list): + ret['submodules'] = [] + for s in self.submodules: + obj: Dict = {'path': s.path} + if s.name: + obj['name'] = s.name + ret['submodules'].append(obj) if self.userdata: ret['userdata'] = self.userdata @@ -1143,7 +1152,7 @@ class ManifestProject(Project): # Pretending that this is a Project, even though it's not (#327) self.description: Optional[str] = None self.url: str = '' - self.submodules = False + self.submodules: SubmodulesType = False self.revision: str = 'HEAD' self.remote_name: str = '' self.clone_depth: Optional[int] = None