summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2023-02-10 07:42:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-15 10:21:34 +0000
commit314944eaaba2984b70af6be243b09cec566f6373 (patch)
tree8e64e4f67928f48dc052a6abd9e24a1cf06f7162
parentac60e31af37c2297c679d67d22e5bcad28ead450 (diff)
downloadpoky-314944eaaba2984b70af6be243b09cec566f6373.tar.gz
bblayers/makesetup: skip git repos that are submodules
(From OE-Core rev: d8bc9cd4ca8ae268a61024f8ac5083a2bbdc432f) 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>
-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):
45 return "" 45 return ""
46 return describe.strip() 46 return describe.strip()
47 47
48 def _is_submodule(self, repo_path):
49 # This is slightly brittle: git does not offer a way to tell whether
50 # a given repo dir is a submodule checkout, so we need to rely on .git
51 # being a file (rather than a dir like it is in standalone checkouts).
52 # The file typically contains a gitdir pointer to elsewhere.
53 return os.path.isfile(os.path.join(repo_path,".git"))
54
48 def make_repo_config(self, destdir): 55 def make_repo_config(self, destdir):
49 """ This is a helper function for the writer plugins that discovers currently configured layers. 56 """ This is a helper function for the writer plugins that discovers currently configured layers.
50 The writers do not have to use it, but it can save a bit of work and avoid duplicated code, hence it is 57 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):
63 logger.error("Layer {name} in {path} has uncommitted modifications or is not in a git repository.".format(name=l_name,path=l_path)) 70 logger.error("Layer {name} in {path} has uncommitted modifications or is not in a git repository.".format(name=l_name,path=l_path))
64 return 71 return
65 repo_path = self._get_repo_path(l_path) 72 repo_path = self._get_repo_path(l_path)
73
74 if self._is_submodule(repo_path):
75 continue
66 if repo_path not in repos.keys(): 76 if repo_path not in repos.keys():
67 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)}} 77 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)}}
68 if repo_path == destdir_repo: 78 if repo_path == destdir_repo: