aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/tests/fetch.py
diff options
context:
space:
mode:
authorChristopher Larson <kergoth@gmail.com>2017-05-13 02:46:32 +0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-26 21:59:26 +0100
commitca0dd3c95502b22c369fbf37f915f45e02c06887 (patch)
tree8f43400b2f3eeb05af60cd2e520e49e6f8ba672b /lib/bb/tests/fetch.py
parent6c0613f1f2f9d4f009545f82a9173e80396f9d34 (diff)
downloadbitbake-contrib-ca0dd3c95502b22c369fbf37f915f45e02c06887.tar.gz
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. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/tests/fetch.py')
-rw-r--r--lib/bb/tests/fetch.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index 2a9019b05..73f7b3f78 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -1234,6 +1234,23 @@ class GitShallowTest(FetcherTest):
assert './.git/modules/' in bb.process.run('tar -tzf %s' % os.path.join(self.dldir, ud.mirrortarballs[0]))[0]
assert os.listdir(os.path.join(self.gitdir, 'gitsubmodule'))
+ if any(os.path.exists(os.path.join(p, 'git-annex')) for p in os.environ.get('PATH').split(':')):
+ def test_shallow_annex(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.git('annex init', cwd=self.srcdir)
+ open(os.path.join(self.srcdir, 'c'), 'w').close()
+ self.git('annex add c', cwd=self.srcdir)
+ self.git('commit -m annex-c -a', cwd=self.srcdir)
+ bb.process.run('chmod u+w -R %s' % os.path.join(self.srcdir, '.git', 'annex'))
+
+ uri = 'gitannex://%s;protocol=file;subdir=${S}' % self.srcdir
+ fetcher, ud = self.fetch_shallow(uri)
+
+ self.assertRevCount(1)
+ assert './.git/annex/' in bb.process.run('tar -tzf %s' % os.path.join(self.dldir, ud.mirrortarballs[0]))[0]
+ assert os.path.exists(os.path.join(self.gitdir, 'c'))
+
def test_shallow_multi_one_uri(self):
# Create initial git repo
self.add_empty_file('a')