diff options
-rw-r--r-- | meta/lib/bblayers/makesetup.py | 10 |
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: |