summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2023-02-10 07:42:10 +0100
committerSteve Sakoman <steve@sakoman.com>2023-02-25 09:25:51 -1000
commit0bbcc17f68943655a95913b0d4c214c0227d24c0 (patch)
tree47997debdd6225c583d166900020dd243f1bb38e
parentbd8920b3a93167ad80f41572b84d120538da22e4 (diff)
downloadopenembedded-core-0bbcc17f68943655a95913b0d4c214c0227d24c0.tar.gz
bblayers/makesetup: skip git repos that are submodules
Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d8bc9cd4ca8ae268a61024f8ac5083a2bbdc432f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/lib/bblayers/makesetup.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/lib/bblayers/makesetup.py b/meta/lib/bblayers/makesetup.py
index 834e9338bc..5fb6f1469e 100644
--- a/meta/lib/bblayers/makesetup.py
+++ b/meta/lib/bblayers/makesetup.py
@@ -45,6 +45,13 @@ class MakeSetupPlugin(LayerPlugin):
return ""
return describe.strip()
+ def _is_submodule(self, repo_path):
+ # This is slightly brittle: git does not offer a way to tell whether
+ # a given repo dir is a submodule checkout, so we need to rely on .git
+ # being a file (rather than a dir like it is in standalone checkouts).
+ # The file typically contains a gitdir pointer to elsewhere.
+ return os.path.isfile(os.path.join(repo_path,".git"))
+
def make_repo_config(self, destdir):
""" This is a helper function for the writer plugins that discovers currently configured layers.
The writers do not have to use it, but it can save a bit of work and avoid duplicated code, hence it is
@@ -63,6 +70,9 @@ class MakeSetupPlugin(LayerPlugin):
logger.error("Layer {name} in {path} has uncommitted modifications or is not in a git repository.".format(name=l_name,path=l_path))
return
repo_path = self._get_repo_path(l_path)
+
+ if self._is_submodule(repo_path):
+ continue
if repo_path not in repos.keys():
repos[repo_path] = {'path':os.path.basename(repo_path),'git-remote':{'rev':l_rev, 'branch':l_branch, 'remotes':self._get_remotes(repo_path), 'describe':self._get_describe(repo_path)}}
if repo_path == destdir_repo: