From: Clement Faure Date: Thu, 12 Feb 2026 10:38:02 +0000 (+0100) Subject: devtool: avoid recursion into nested git repos with submodules X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c63fa18db31e329dca0ba86be078cd8a723ead0e;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git devtool: avoid recursion into nested git repos with submodules Prevent devtool from recursing into nested git repositories with submodules to avoid double git submodule add operation. Signed-off-by: Clement Faure Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 7c8de5540c..cb727f324f 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py @@ -249,6 +249,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 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)