summaryrefslogtreecommitdiffstats
path: root/meta/lib
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-03-06 15:09:42 +0000
commitac646d8c1e1c792d3cbea997f50b3fae8612ee24 (patch)
treedae82bc9e93f0159691998028540c50d5a96beba /meta/lib
parent28206ebda59a00ad5da9c581e1195bf63254af9d (diff)
downloadpoky-ac646d8c1e1c792d3cbea997f50b3fae8612ee24.tar.gz
bblayers/makesetup: skip git repos that are submodules
(From OE-Core rev: 0bbcc17f68943655a95913b0d4c214c0227d24c0) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-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: