summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/gitannex.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/gitannex.py')
-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)