diff options
author | Urs Fässler <urs.fassler@bbv.ch> | 2018-10-08 08:15:10 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-18 10:59:26 +0100 |
commit | 0d4fe0602ef4ac80f3cea471e48b96b71a585669 (patch) | |
tree | c790ef940b5d593b54fcee9dde3a6d5258bf6645 /bitbake/lib/bb/tests | |
parent | 49f25eceeb2c2c1e7c2838ba55768e9fc7dff53f (diff) | |
download | openembedded-core-contrib-0d4fe0602ef4ac80f3cea471e48b96b71a585669.tar.gz |
bitbake: fetch2/git: prevent access to non-existing clonedir
A user friendly error is throw when neither the clonedir nor
fullshallow exist. Without the check, a difficult to interpret error
is throw from within the fetch command.
(Bitbake rev: 30cf2506007d25162f0805051212f54c39034ff3)
Signed-off-by: Urs Fässler <urs.fassler@bbv.ch>
Signed-off-by: Pascal Bach <pascal.bach@siemens.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.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 9bed06ba0e..f52241fbea 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py @@ -1699,6 +1699,17 @@ class GitShallowTest(FetcherTest): self.assertRefs(['master', 'origin/master']) self.assertRevCount(orig_revs - 1758) + def test_that_unpack_throws_an_error_when_the_git_clone_nor_shallow_tarball_exist(self): + self.add_empty_file('a') + fetcher, ud = self.fetch() + bb.utils.remove(self.gitdir, recurse=True) + bb.utils.remove(self.dldir, recurse=True) + + with self.assertRaises(bb.fetch2.UnpackError) as context: + fetcher.unpack(self.d.getVar('WORKDIR')) + + self.assertTrue("No up to date source found" in context.exception.msg) + @skipIfNoNetwork() def test_that_unpack_does_work_when_using_git_shallow_tarball_but_tarball_is_not_available(self): self.d.setVar('SRCREV', 'e5939ff608b95cdd4d0ab0e1935781ab9a276ac0') |