summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests
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/tests
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/tests')
-rw-r--r--bitbake/lib/bb/tests/fetch.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index 2a9019b05f..73f7b3f78e 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -1234,6 +1234,23 @@ class GitShallowTest(FetcherTest):
1234 assert './.git/modules/' in bb.process.run('tar -tzf %s' % os.path.join(self.dldir, ud.mirrortarballs[0]))[0] 1234 assert './.git/modules/' in bb.process.run('tar -tzf %s' % os.path.join(self.dldir, ud.mirrortarballs[0]))[0]
1235 assert os.listdir(os.path.join(self.gitdir, 'gitsubmodule')) 1235 assert os.listdir(os.path.join(self.gitdir, 'gitsubmodule'))
1236 1236
1237 if any(os.path.exists(os.path.join(p, 'git-annex')) for p in os.environ.get('PATH').split(':')):
1238 def test_shallow_annex(self):
1239 self.add_empty_file('a')
1240 self.add_empty_file('b')
1241 self.git('annex init', cwd=self.srcdir)
1242 open(os.path.join(self.srcdir, 'c'), 'w').close()
1243 self.git('annex add c', cwd=self.srcdir)
1244 self.git('commit -m annex-c -a', cwd=self.srcdir)
1245 bb.process.run('chmod u+w -R %s' % os.path.join(self.srcdir, '.git', 'annex'))
1246
1247 uri = 'gitannex://%s;protocol=file;subdir=${S}' % self.srcdir
1248 fetcher, ud = self.fetch_shallow(uri)
1249
1250 self.assertRevCount(1)
1251 assert './.git/annex/' in bb.process.run('tar -tzf %s' % os.path.join(self.dldir, ud.mirrortarballs[0]))[0]
1252 assert os.path.exists(os.path.join(self.gitdir, 'c'))
1253
1237 def test_shallow_multi_one_uri(self): 1254 def test_shallow_multi_one_uri(self):
1238 # Create initial git repo 1255 # Create initial git repo
1239 self.add_empty_file('a') 1256 self.add_empty_file('a')