Prevent devtool from recursing into nested git repositories with
submodules to avoid double git submodule add operation.

Signed-off-by: Clement Faure <[email protected]>
---
 scripts/lib/devtool/__init__.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 969d6dc13a..dd7501440e 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -248,6 +248,10 @@ def setup_git_repo(repodir, version, devbranch, 
basetag='devtool-base', d=None):
                     remote_url = stdout.splitlines()[0]
                     logger.error(os.path.relpath(os.path.join(root, ".."), 
root))
                     bb.process.run('git submodule add %s %s' % (remote_url, 
os.path.relpath(root, os.path.join(root, ".."))), cwd=os.path.join(root, ".."))
+                    # Do not descend into nested git repos that have 
submodules themselves.
+                    if ".gitmodules" in dirs + files:
+                        logger.warning('Nested git repository with submodules 
%s; devtool will not recurse into it', root)
+                        dirs[:] = []
                     found = True
                 if found:
                     oe.patch.GitApplyTree.commitIgnored("Add additional 
submodule from SRC_URI", dir=os.path.join(root, ".."), d=d)
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#230537): 
https://lists.openembedded.org/g/openembedded-core/message/230537
Mute This Topic: https://lists.openembedded.org/mt/117634842/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to