@@ -658,10 +658,12 @@ This fetcher supports the following parameters:
- *"manifest":* Name of the manifest file (default: ``default.xml``).
+- *"fetch_submodules":* Whether to fetch Git submodules of a project on the server (default: ``0``).
+
Here are some example URLs::
SRC_URI = "repo://REPOROOT;protocol=git;branch=some_branch;manifest=my_manifest.xml"
- SRC_URI = "repo://REPOROOT;protocol=file;branch=some_branch;manifest=my_manifest.xml"
+ SRC_URI = "repo://REPOROOT;protocol=file;branch=some_branch;manifest=my_manifest.xml;fetch_submodules=1"
.. _az-fetcher:
@@ -38,6 +38,7 @@ class Repo(FetchMethod):
ud.proto = ud.parm.get('protocol', 'git')
ud.branch = ud.parm.get('branch', 'master')
ud.manifest = ud.parm.get('manifest', 'default.xml')
+ ud.fetch_submodules = ud.parm.get('fetch_submodules', '0') == '1'
if not ud.manifest.endswith('.xml'):
ud.manifest += '.xml'
@@ -65,8 +66,12 @@ class Repo(FetchMethod):
bb.fetch2.check_network_access(d, "%s init -m %s -b %s -u %s://%s%s%s" % (ud.basecmd, ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), ud.url)
runfetchcmd("%s init -m %s -b %s -u %s://%s%s%s" % (ud.basecmd, ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), d, workdir=repodir)
- bb.fetch2.check_network_access(d, "%s sync %s" % (ud.basecmd, ud.url), ud.url)
- runfetchcmd("%s sync" % ud.basecmd, d, workdir=repodir)
+ sync_cmd = "sync"
+ if ud.fetch_submodules:
+ sync_cmd = "%s --fetch-submodules" % sync_cmd
+
+ bb.fetch2.check_network_access(d, "%s %s %s" % (ud.basecmd, sync_cmd, ud.url), ud.url)
+ runfetchcmd("%s %s" % (ud.basecmd, sync_cmd), d, workdir=repodir)
scmdata = ud.parm.get("scmdata", "")
if scmdata == "keep":
Add the fetch_submodules parameter, which allows fetching submodules of projects by passing the --fetch-submodules option to repo sync. Signed-off-by: Johannes Kauffmann <johanneskauffmann@hotmail.com> --- doc/bitbake-user-manual/bitbake-user-manual-fetching.rst | 4 +++- lib/bb/fetch2/repo.py | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-)