From: Mark Hatle <mark.hatle@kernel.crashing.org>
To: jdmason@kudzu.us, bitbake-devel@lists.openembedded.org
Subject: [PATCH v2] bitbake: layerindex: use branch when specified
Date: Thu, 19 Dec 2019 11:39:08 -0600 [thread overview]
Message-ID: <20191219173908.46461-1-mark.hatle@kernel.crashing.org> (raw)
From: Jon Mason <jdmason@kudzu.us>
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>
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>
---
lib/bblayers/layerindex.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/lib/bblayers/layerindex.py b/lib/bblayers/layerindex.py
index 57cd9027..aa3b682d 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,9 +32,13 @@ 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])
+ cmd = ['git', 'clone', '-b' , branch, url, repodir]
+ if not branch:
+ # Branch really shouldn't be empty, but use the repo default if it is
+ cmd = ['git', 'clone', url, repodir]
+ result = subprocess.call(cmd)
if result:
- logger.error("Failed to download %s" % url)
+ logger.error("Failed to download %s (%s)" % (url, branch))
return None, None, None
else:
return subdir, layername, layerdir
@@ -171,7 +175,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,
+ layerBranch.actual_branch)
if not name:
# Error already shown
return 1
--
2.17.1
next reply other threads:[~2019-12-19 17:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-19 17:39 Mark Hatle [this message]
2019-12-19 20:50 ` [PATCH v2] bitbake: layerindex: use branch when specified Jon Mason
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=20191219173908.46461-1-mark.hatle@kernel.crashing.org \
--to=mark.hatle@kernel.crashing.org \
--cc=bitbake-devel@lists.openembedded.org \
--cc=jdmason@kudzu.us \
/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.