diff mbox series

[3/6] devtool: tag all submodules

Message ID 20231122110818.932618-4-jstephan@baylibre.com
State Accepted, archived
Commit 241da68805d177d4ec4b302c8a997645cc645286
Headers show
Series devtool: add support of submodules | expand

Commit Message

Julien Stephan Nov. 22, 2023, 11:08 a.m. UTC
In the case of a repository with submodules, we need to add the
"devtool-base" and "devtool-patched" tag on all submodules in order to
properly detect the added/removed/modified patches

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
---
 meta/classes/devtool-source.bbclass | 3 +++
 scripts/lib/devtool/__init__.py     | 3 +++
 2 files changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/meta/classes/devtool-source.bbclass b/meta/classes/devtool-source.bbclass
index a02b1e9b0ec..4158c20c7e8 100644
--- a/meta/classes/devtool-source.bbclass
+++ b/meta/classes/devtool-source.bbclass
@@ -232,6 +232,9 @@  python devtool_post_patch() {
                 bb.process.run('git rebase devtool-no-overrides', cwd=srcsubdir)
         bb.process.run('git checkout %s' % devbranch, cwd=srcsubdir)
     bb.process.run('git tag -f devtool-patched', cwd=srcsubdir)
+    if os.path.exists(os.path.join(srcsubdir, '.gitmodules')):
+        bb.process.run('git submodule foreach --recursive  "git tag -f devtool-patched"', cwd=srcsubdir)
+
 }
 
 python devtool_post_configure() {
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 702db669de3..e9e88a55336 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -233,6 +233,9 @@  def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None):
     bb.process.run('git checkout -b %s' % devbranch, cwd=repodir)
     bb.process.run('git tag -f %s' % basetag, cwd=repodir)
 
+    if os.path.exists(os.path.join(repodir, '.gitmodules')):
+        bb.process.run('git submodule foreach --recursive  "git tag -f %s"' % basetag, cwd=repodir)
+
 def recipe_to_append(recipefile, config, wildcard=False):
     """
     Convert a recipe file to a bbappend file path within the workspace.