From b907303b92f597d159d1057a9d47148a23f30219 Mon Sep 17 00:00:00 2001 From: Urs Fässler Date: Wed, 3 Oct 2018 12:04:06 +0000 Subject: bitbake: fetch2/git: prevent access to non-existing fullshallow tarball MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Bitbake rev: b7f00a8c11672a2ee0408e210fb174cda3384e3f) Signed-off-by: Urs Fässler Signed-off-by: Pascal Bach Signed-off-by: Richard Purdie --- bitbake/lib/bb/tests/fetch.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bitbake/lib/bb/tests') diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 2c314f46d7..ff66315aa5 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py @@ -1580,3 +1580,17 @@ class GitShallowTest(FetcherTest): self.assertNotEqual(orig_revs, revs) self.assertRefs(['master', 'origin/master']) self.assertRevCount(orig_revs - 1758) + + @skipIfNoNetwork() + def test_that_unpack_does_work_when_using_git_shallow_tarball_but_tarball_is_not_available(self): + self.d.setVar('SRCREV', 'e5939ff608b95cdd4d0ab0e1935781ab9a276ac0') + self.d.setVar('BB_GIT_SHALLOW', '1') + self.d.setVar('BB_GENERATE_SHALLOW_TARBALLS', '1') + fetcher = bb.fetch.Fetch(["git://git.yoctoproject.org/fstests"], self.d) + fetcher.download() + + bb.utils.remove(self.dldir + "/*.tar.gz") + fetcher.unpack(self.unpackdir) + + dir = os.listdir(self.unpackdir + "/git/") + self.assertIn("fstests.doap", dir) -- cgit v1.2.3-54-g00ecf