All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake: layerindex: use branch when specified
@ 2019-12-18 18:45 Jon Mason
  2019-12-19  2:44 ` Mark Hatle
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Mason @ 2019-12-18 18:45 UTC (permalink / raw)
  To: bitbake-devel

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.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
---
 bitbake/lib/bblayers/layerindex.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/bblayers/layerindex.py b/bitbake/lib/bblayers/layerindex.py
index 57cd9027f6..55029e0482 100644
--- a/bitbake/lib/bblayers/layerindex.py
+++ b/bitbake/lib/bblayers/layerindex.py
@@ -24,7 +24,7 @@ class LayerIndexPlugin(ActionPlugin):
     This class inherits ActionPlugin to get do_add_layer.
     """
 
-    def get_fetch_layer(self, fetchdir, url, subdir, fetch_layer):
+    def get_fetch_layer(self, fetchdir, url, subdir, fetch_layer, branch):
         layername = self.get_layer_name(url)
         if os.path.splitext(layername)[1] == '.git':
             layername = os.path.splitext(layername)[0]
@@ -32,7 +32,9 @@ class LayerIndexPlugin(ActionPlugin):
         layerdir = os.path.join(repodir, subdir)
         if not os.path.exists(repodir):
             if fetch_layer:
-                result = subprocess.call(['git', 'clone', url, repodir])
+                if not branch:
+                    branch = "master"
+                result = subprocess.call(['git', 'clone', '-b' , branch, url, repodir])
                 if result:
                     logger.error("Failed to download %s" % url)
                     return None, None, None
@@ -171,7 +173,8 @@ class LayerIndexPlugin(ActionPlugin):
                 subdir, name, layerdir = self.get_fetch_layer(fetchdir,
                                                       layerBranch.layer.vcs_url,
                                                       layerBranch.vcs_subdir,
-                                                      not args.show_only)
+                                                      not args.show_only,
+                                                      args.branch)
                 if not name:
                     # Error already shown
                     return 1
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-19 17:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-18 18:45 [PATCH] bitbake: layerindex: use branch when specified Jon Mason
2019-12-19  2:44 ` Mark Hatle
2019-12-19 16:18   ` Mark Hatle
2019-12-19 17:02     ` Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.