diff options
author | Christopher Larson <kergoth@gmail.com> | 2017-05-13 02:46:31 +0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-02 13:36:57 +0100 |
commit | f5308b8cc167e2fbb25406da074c334960902b20 (patch) | |
tree | 48b667e0bdd00f8dd439473e84f5c2f73ba09d67 /bitbake/lib/bb/fetch2 | |
parent | 8144f6f408a77b7fb3367a91c55288b977a9bf88 (diff) | |
download | poky-f5308b8cc167e2fbb25406da074c334960902b20.tar.gz |
bitbake: fetch/gitsm: add support for shallow mirror tarballs
When we're building from a shallow mirror tarball, we don't want to do
anything with ud.clonedir, as it's not being used when we unpack. As such,
disable updating the submodules in that case. Also include the repositories in
.git/modules in the shallow tarball. It does not actually make the submodule
repositories shallow at this time.
(Bitbake rev: 6c0613f1f2f9d4f009545f82a9173e80396f9d34)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/gitsm.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index a95584c821..0aff1008e5 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py | |||
@@ -117,14 +117,19 @@ class GitSM(Git): | |||
117 | def download(self, ud, d): | 117 | def download(self, ud, d): |
118 | Git.download(self, ud, d) | 118 | Git.download(self, ud, d) |
119 | 119 | ||
120 | submodules = self.uses_submodules(ud, d, ud.clonedir) | 120 | if not ud.shallow or ud.localpath != ud.fullshallow: |
121 | if submodules: | 121 | submodules = self.uses_submodules(ud, d, ud.clonedir) |
122 | self.update_submodules(ud, d) | 122 | if submodules: |
123 | self.update_submodules(ud, d) | ||
124 | |||
125 | def clone_shallow_local(self, ud, dest, d): | ||
126 | super(GitSM, self).clone_shallow_local(ud, dest, d) | ||
127 | |||
128 | runfetchcmd('cp -fpPRH "%s/modules" "%s/"' % (ud.clonedir, os.path.join(dest, '.git')), d) | ||
123 | 129 | ||
124 | def unpack(self, ud, destdir, d): | 130 | def unpack(self, ud, destdir, d): |
125 | Git.unpack(self, ud, destdir, d) | 131 | Git.unpack(self, ud, destdir, d) |
126 | 132 | ||
127 | submodules = self.uses_submodules(ud, d, ud.destdir) | 133 | if self.uses_submodules(ud, d, ud.destdir): |
128 | if submodules: | ||
129 | runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d, workdir=ud.destdir) | 134 | runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d, workdir=ud.destdir) |
130 | runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=ud.destdir) | 135 | runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=ud.destdir) |