diff options
author | Randolph Sapp <rs@ti.com> | 2023-08-18 19:10:11 -0500 |
---|---|---|
committer | Luca Ceresoli <luca.ceresoli@bootlin.com> | 2023-08-25 10:15:50 +0200 |
commit | 1f8f21fe024b391d3a6670c64b839db0eee083c3 (patch) | |
tree | 9217cbf57513371e15c762a096e9c84265374a75 /lib | |
parent | 95088b447f563c5e1d9630e6acb32787b5ebed9c (diff) | |
download | bitbake-contrib-1f8f21fe024b391d3a6670c64b839db0eee083c3.tar.gz |
gitsm: tolerate git-lfs in submodules
Explicitly pass down the lfs parameter from the source repo URI to
submodules. Add smudge skip to final checkout phase to make sure we
don't access the network here. Everything should have been fetched and
setup from the lfs logic in the git fetcher at this point.
Signed-off-by: Randolph Sapp <rs@ti.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/fetch2/gitsm.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py index 47225b972..a87361ccf 100644 --- a/lib/bb/fetch2/gitsm.py +++ b/lib/bb/fetch2/gitsm.py @@ -123,6 +123,7 @@ class GitSM(Git): url += ";name=%s" % module url += ";subpath=%s" % module url += ";nobranch=1" + url += ";lfs=%s" % self._need_lfs(ud) # Note that adding "user=" here to give credentials to the # submodule is not supported. Since using SRC_URI to give git:// # URL a password is not supported, one have to use one of the @@ -242,10 +243,12 @@ class GitSM(Git): ret = self.process_submodules(ud, ud.destdir, unpack_submodules, d) if not ud.bareclone and ret: - # All submodules should already be downloaded and configured in the tree. This simply sets - # up the configuration and checks out the files. The main project config should remain - # unmodified, and no download from the internet should occur. - runfetchcmd("%s submodule update --recursive --no-fetch" % (ud.basecmd), d, quiet=True, workdir=ud.destdir) + # All submodules should already be downloaded and configured in the tree. This simply + # sets up the configuration and checks out the files. The main project config should + # remain unmodified, and no download from the internet should occur. As such, lfs smudge + # should also be skipped as these files were already smudged in the fetch stage if lfs + # was enabled. + runfetchcmd("GIT_LFS_SKIP_SMUDGE=1 %s submodule update --recursive --no-fetch" % (ud.basecmd), d, quiet=True, workdir=ud.destdir) def implicit_urldata(self, ud, d): import shutil, subprocess, tempfile |