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.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/bitbake/lib/bb/fetch2/gitannex.py b/bitbake/lib/bb/fetch2/gitannex.py
index e4527f1c75..4937a10891 100644
--- a/bitbake/lib/bb/fetch2/gitannex.py
+++ b/bitbake/lib/bb/fetch2/gitannex.py
@@ -34,43 +34,42 @@ class GitANNEX(Git):
34 """ 34 """
35 return ud.type in ['gitannex'] 35 return ud.type in ['gitannex']
36 36
37 def uses_annex(self, ud, d): 37 def uses_annex(self, ud, d, wd):
38 for name in ud.names: 38 for name in ud.names:
39 try: 39 try:
40 runfetchcmd("%s rev-list git-annex" % (ud.basecmd), d, quiet=True) 40 runfetchcmd("%s rev-list git-annex" % (ud.basecmd), d, quiet=True, workdir=wd)
41 return True 41 return True
42 except bb.fetch.FetchError: 42 except bb.fetch.FetchError:
43 pass 43 pass
44 44
45 return False 45 return False
46 46
47 def update_annex(self, ud, d): 47 def update_annex(self, ud, d, wd):
48 try: 48 try:
49 runfetchcmd("%s annex get --all" % (ud.basecmd), d, quiet=True) 49 runfetchcmd("%s annex get --all" % (ud.basecmd), d, quiet=True, workdir=wd)
50 except bb.fetch.FetchError: 50 except bb.fetch.FetchError:
51 return False 51 return False
52 runfetchcmd("chmod u+w -R %s/annex" % (ud.clonedir), d, quiet=True) 52 runfetchcmd("chmod u+w -R %s/annex" % (ud.clonedir), d, quiet=True, workdir=wd)
53 53
54 return True 54 return True
55 55
56 def download(self, ud, d): 56 def download(self, ud, d):
57 Git.download(self, ud, d) 57 Git.download(self, ud, d)
58 58
59 os.chdir(ud.clonedir) 59 annex = self.uses_annex(ud, d, ud.clonedir)
60 annex = self.uses_annex(ud, d)
61 if annex: 60 if annex:
62 self.update_annex(ud, d) 61 self.update_annex(ud, d, ud.clonedir)
63 62
64 def unpack(self, ud, destdir, d): 63 def unpack(self, ud, destdir, d):
65 Git.unpack(self, ud, destdir, d) 64 Git.unpack(self, ud, destdir, d)
66 65
67 os.chdir(ud.destdir)
68 try: 66 try:
69 runfetchcmd("%s annex init" % (ud.basecmd), d) 67 runfetchcmd("%s annex init" % (ud.basecmd), d, workdir=ud.destdir)
70 except bb.fetch.FetchError: 68 except bb.fetch.FetchError:
71 pass 69 pass
72 70
73 annex = self.uses_annex(ud, d) 71 annex = self.uses_annex(ud, d, ud.destdir)
74 if annex: 72 if annex:
75 runfetchcmd("%s annex get" % (ud.basecmd), d) 73 runfetchcmd("%s annex get" % (ud.basecmd), d, workdir=ud.destdir)
76 runfetchcmd("chmod u+w -R %s/.git/annex" % (ud.destdir), d, quiet=True) 74 runfetchcmd("chmod u+w -R %s/.git/annex" % (ud.destdir), d, quiet=True, workdir=ud.destdir)
75