summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
authorChristopher Larson <kergoth@gmail.com>2017-05-13 02:46:32 +0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-02 13:36:57 +0100
commit30485b2b1a3d49e0a72c9370e2ca2e763d83ace6 (patch)
tree2e98434f02a6b8998dd9fff39fb3f1ea6d048497 /bitbake/lib/bb/fetch2
parentf5308b8cc167e2fbb25406da074c334960902b20 (diff)
downloadpoky-30485b2b1a3d49e0a72c9370e2ca2e763d83ace6.tar.gz
bitbake: fetch/gitannex: 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 annex in that case. Also include annex files in the shallow tarball. (Bitbake rev: ca0dd3c95502b22c369fbf37f915f45e02c06887) 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/gitannex.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/gitannex.py b/bitbake/lib/bb/fetch2/gitannex.py
index c66c211428..a9b69caab4 100644
--- a/bitbake/lib/bb/fetch2/gitannex.py
+++ b/bitbake/lib/bb/fetch2/gitannex.py
@@ -33,6 +33,11 @@ class GitANNEX(Git):
33 """ 33 """
34 return ud.type in ['gitannex'] 34 return ud.type in ['gitannex']
35 35
36 def urldata_init(self, ud, d):
37 super(GitANNEX, self).urldata_init(ud, d)
38 if ud.shallow:
39 ud.shallow_extra_refs += ['refs/heads/git-annex', 'refs/heads/synced/*']
40
36 def uses_annex(self, ud, d, wd): 41 def uses_annex(self, ud, d, wd):
37 for name in ud.names: 42 for name in ud.names:
38 try: 43 try:
@@ -55,9 +60,21 @@ class GitANNEX(Git):
55 def download(self, ud, d): 60 def download(self, ud, d):
56 Git.download(self, ud, d) 61 Git.download(self, ud, d)
57 62
58 annex = self.uses_annex(ud, d, ud.clonedir) 63 if not ud.shallow or ud.localpath != ud.fullshallow:
59 if annex: 64 if self.uses_annex(ud, d, ud.clonedir):
60 self.update_annex(ud, d, ud.clonedir) 65 self.update_annex(ud, d, ud.clonedir)
66
67 def clone_shallow_local(self, ud, dest, d):
68 super(GitANNEX, self).clone_shallow_local(ud, dest, d)
69
70 try:
71 runfetchcmd("%s annex init" % ud.basecmd, d, workdir=dest)
72 except bb.fetch.FetchError:
73 pass
74
75 if self.uses_annex(ud, d, dest):
76 runfetchcmd("%s annex get" % ud.basecmd, d, workdir=dest)
77 runfetchcmd("chmod u+w -R %s/.git/annex" % (dest), d, quiet=True, workdir=dest)
61 78
62 def unpack(self, ud, destdir, d): 79 def unpack(self, ud, destdir, d):
63 Git.unpack(self, ud, destdir, d) 80 Git.unpack(self, ud, destdir, d)