From: "Sourabh Banerjee" <sbanerje@codeaurora.org>
To: openembedded-core@lists.openembedded.org
Cc: Sourabh Banerjee <sbanerje@codeaurora.org>
Subject: [bitbake][PATCH 2/3] bitbake: fetch2/repo: add support for sync specific projects
Date: Sun, 16 May 2021 16:53:12 +0530 [thread overview]
Message-ID: <1621164193-9434-2-git-send-email-sbanerje@codeaurora.org> (raw)
In-Reply-To: <1621164193-9434-1-git-send-email-sbanerje@codeaurora.org>
repo tool can fetch projects by name. I.e., if there are
multiple projects listed in the manifest file.
<manifest>
<project name="project1" path="sync path1" revision="sha256" />
<project name="project2" path="sync path2" revision="sha256" />
</manifest>
Documented Usage: repo sync [<project>...]
By supplying project=<project_name> recipe can choose to sync a specific
project.
Example:
SRC_URI = "repo://REPOROOT;protocol=git;branch=main;manifest=default.xml;project=project1"
This is helpful when recipe needs to sync only a specific project
from a manifest that lists multiple projects.
Signed-off-by: Sourabh Banerjee <sbanerje@codeaurora.org>
---
bitbake/lib/bb/fetch2/repo.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/bitbake/lib/bb/fetch2/repo.py b/bitbake/lib/bb/fetch2/repo.py
index 8547b9e..e7c5255 100644
--- a/bitbake/lib/bb/fetch2/repo.py
+++ b/bitbake/lib/bb/fetch2/repo.py
@@ -41,7 +41,10 @@ class Repo(FetchMethod):
if not ud.manifest.endswith('.xml'):
ud.manifest += '.xml'
- ud.localfile = d.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch))
+ project = ud.parm.get('project', '')
+ if len(project):
+ project = '_' + project
+ ud.localfile = d.expand("repo_%s%s_%s_%s%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch, project.replace("/", ".")))
def download(self, ud, d):
"""Fetch url"""
@@ -52,7 +55,8 @@ class Repo(FetchMethod):
repodir = d.getVar("REPODIR") or (d.getVar("DL_DIR") + "/repo")
gitsrcname = "%s%s" % (ud.host, ud.path.replace("/", "."))
- codir = os.path.join(repodir, gitsrcname, ud.manifest)
+ project = ud.parm.get('project', '')
+ codir = os.path.join(repodir, gitsrcname, ud.manifest, project.replace("/", "."))
if ud.user:
username = ud.user + "@"
@@ -76,7 +80,7 @@ class Repo(FetchMethod):
if jobs:
jobs = '-j' + jobs
bb.fetch2.check_network_access(d, "%s sync %s" % (ud.basecmd, ud.url), ud.url)
- runfetchcmd("%s sync %s" % (ud.basecmd, jobs), d, workdir=repodir)
+ runfetchcmd("%s sync %s %s" % (ud.basecmd, jobs, project), d, workdir=repodir)
scmdata = ud.parm.get("scmdata", "")
if scmdata == "keep":
--
2.7.4
--
Regards,
Sourabh
next prev parent reply other threads:[~2021-05-16 11:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-16 11:23 [bitbake][PATCH 1/3] bitbake: fetch2/repo: add support for projects to be fetched simultaneously Sourabh Banerjee
2021-05-16 11:23 ` Sourabh Banerjee [this message]
2021-05-16 11:23 ` [bitbake][PATCH 3/3] bitbake: fetch2/repo: add support for --repo-url and --repo-branch Sourabh Banerjee
2021-05-16 12:43 ` [OE-core] " Richard Purdie
2021-05-16 14:10 ` Sourabh Banerjee
2021-05-16 12:40 ` [OE-core] [bitbake][PATCH 1/3] bitbake: fetch2/repo: add support for projects to be fetched simultaneously Richard Purdie
2021-05-16 13:19 ` Sourabh Banerjee
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=1621164193-9434-2-git-send-email-sbanerje@codeaurora.org \
--to=sbanerje@codeaurora.org \
--cc=openembedded-core@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.