summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bblayers
diff options
context:
space:
mode:
authorJon Mason <jdmason@kudzu.us>2019-12-19 17:39:08 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-15 10:27:45 (GMT)
commiteae875dae728987575f1d797b6497900be5a0cb7 (patch)
treedfd3597c589a371284faab94b14b9a33afd9cc0e /bitbake/lib/bblayers
parentaf0785bcbc679c45ca137eb20c04dfb2775a22e5 (diff)
downloadpoky-eae875dae728987575f1d797b6497900be5a0cb7.tar.gz
bitbake: bitbake: layerindex: use branch when specified
When currently specified, the branch is used to verify the versioning of the meta layer, but the master branch is checked out. This change allows for the branch to be specified. Now it is easy to specify all of the meta layers being added are of the same version, without having to do it in each individual git tree. Also, it will error if there are branches without a matching version. Finally, this allows for meta layer git trees without a master branch. (Bitbake rev: 4ec49f42f327068890e7aad8553d7f282e2ffaa1) Signed-off-by: Jon Mason <jdmason@kudzu.us> Minor rework of the patch to use the layerBranch actual_branch since the layerindex referenced branch may be different then the overall release branch. Also adjust the patch to use the default git checkout branch instead of master if no branch was specified. (Some repositories don't have a master branch.) Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bblayers')
-rw-r--r--bitbake/lib/bblayers/layerindex.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/bitbake/lib/bblayers/layerindex.py b/bitbake/lib/bblayers/layerindex.py
index 57cd902..aa3b682 100644
--- a/bitbake/lib/bblayers/layerindex.py
+++ b/bitbake/lib/bblayers/layerindex.py
@@ -24,7 +24,7 @@ class LayerIndexPlugin(ActionPlugin):
24 This class inherits ActionPlugin to get do_add_layer. 24 This class inherits ActionPlugin to get do_add_layer.
25 """ 25 """
26 26
27 def get_fetch_layer(self, fetchdir, url, subdir, fetch_layer): 27 def get_fetch_layer(self, fetchdir, url, subdir, fetch_layer, branch):
28 layername = self.get_layer_name(url) 28 layername = self.get_layer_name(url)
29 if os.path.splitext(layername)[1] == '.git': 29 if os.path.splitext(layername)[1] == '.git':
30 layername = os.path.splitext(layername)[0] 30 layername = os.path.splitext(layername)[0]
@@ -32,9 +32,13 @@ class LayerIndexPlugin(ActionPlugin):
32 layerdir = os.path.join(repodir, subdir) 32 layerdir = os.path.join(repodir, subdir)
33 if not os.path.exists(repodir): 33 if not os.path.exists(repodir):
34 if fetch_layer: 34 if fetch_layer:
35 result = subprocess.call(['git', 'clone', url, repodir]) 35 cmd = ['git', 'clone', '-b' , branch, url, repodir]
36 if not branch:
37 # Branch really shouldn't be empty, but use the repo default if it is
38 cmd = ['git', 'clone', url, repodir]
39 result = subprocess.call(cmd)
36 if result: 40 if result:
37 logger.error("Failed to download %s" % url) 41 logger.error("Failed to download %s (%s)" % (url, branch))
38 return None, None, None 42 return None, None, None
39 else: 43 else:
40 return subdir, layername, layerdir 44 return subdir, layername, layerdir
@@ -171,7 +175,8 @@ class LayerIndexPlugin(ActionPlugin):
171 subdir, name, layerdir = self.get_fetch_layer(fetchdir, 175 subdir, name, layerdir = self.get_fetch_layer(fetchdir,
172 layerBranch.layer.vcs_url, 176 layerBranch.layer.vcs_url,
173 layerBranch.vcs_subdir, 177 layerBranch.vcs_subdir,
174 not args.show_only) 178 not args.show_only,
179 layerBranch.actual_branch)
175 if not name: 180 if not name:
176 # Error already shown 181 # Error already shown
177 return 1 182 return 1