All of lore.kernel.org
 help / color / mirror / Atom feed
From: dl9pf@gmx.de
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH] Fix bitbake-layerindex to checkout the requested branch
Date: Fri, 14 Feb 2020 15:22:00 +0100	[thread overview]
Message-ID: <20200214142200.28757-1-dl9pf@gmx.de> (raw)

From: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>

Bitbake-layerindex would not respect the branch given with -b .
This fixes the clone command.

Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
---
 lib/bblayers/layerindex.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/bblayers/layerindex.py b/lib/bblayers/layerindex.py
index 57cd9027..093434ac 100644
--- a/lib/bblayers/layerindex.py
+++ b/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,7 @@ 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])
+                result = subprocess.call(['git', 'clone', '-b', branch, url, repodir])
                 if result:
                     logger.error("Failed to download %s" % url)
                     return None, None, None
@@ -70,9 +70,9 @@ class LayerIndexPlugin(ActionPlugin):

         # Set the default...
         if args.branch:
-            branches = [args.branch]
+            branch = [args.branch]
         else:
-            branches = (self.tinfoil.config_data.getVar('LAYERSERIES_CORENAMES') or 'master').split()
+            branch = (self.tinfoil.config_data.getVar('LAYERSERIES_CORENAMES') or 'master').split()
         logger.debug(1, 'Trying branches: %s' % branches)

         ignore_layers = []
@@ -171,7 +171,7 @@ 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, branch)
                 if not name:
                     # Error already shown
                     return 1
--
2.11.0



             reply	other threads:[~2020-02-14 14:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 14:22 dl9pf [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-02-14 14:47 [PATCH] Fix bitbake-layerindex to checkout the requested branch dl9pf
2020-02-14 15:01 dl9pf
2020-02-14 15:32 ` Peter Kjellerstedt
2020-02-14 18:08 ` Mark Hatle
2020-02-14 21:07   ` "Jan-Simon Möller"

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200214142200.28757-1-dl9pf@gmx.de \
    --to=dl9pf@gmx.de \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.