mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
patch.py: Prevent git repo reinitialization
There were few bugs in the _isInitialized() function which might trigger git repo to be reinitialized and patches failing to apply. (From OE-Core rev: 80500ecda4c1bc8812e6e078b6b0db5ec46624de) Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
e43a9d15ea
commit
da344db43c
@@ -307,11 +307,26 @@ INHERIT:remove = \"report-error\"
|
||||
src = get_bb_var("SRC_URI",test_recipe)
|
||||
gitscm = re.search("git://", src)
|
||||
self.assertFalse(gitscm, "test_git_patchtool pre-condition failed: {} test recipe contains git repo!".format(test_recipe))
|
||||
result = bitbake('man-db -c patch', ignore_status=False)
|
||||
result = bitbake('{} -c patch'.format(test_recipe), ignore_status=False)
|
||||
fatal = re.search("fatal: not a git repository (or any of the parent directories)", result.output)
|
||||
self.assertFalse(fatal, "Failed to patch using PATCHTOOL=\"git\"")
|
||||
self.delete_recipeinc(test_recipe)
|
||||
bitbake('-cclean man-db')
|
||||
bitbake('-cclean {}'.format(test_recipe))
|
||||
|
||||
def test_git_patchtool2(self):
|
||||
""" Test if PATCHTOOL=git works with git repo and doesn't reinitialize it
|
||||
"""
|
||||
test_recipe = "gitrepotest"
|
||||
src = get_bb_var("SRC_URI",test_recipe)
|
||||
gitscm = re.search("git://", src)
|
||||
self.assertTrue(gitscm, "test_git_patchtool pre-condition failed: {} test recipe doesn't contains git repo!".format(test_recipe))
|
||||
result = bitbake('{} -c patch'.format(test_recipe), ignore_status=False)
|
||||
srcdir = get_bb_var('S', test_recipe)
|
||||
result = runCmd("git log", cwd = srcdir)
|
||||
self.assertFalse("bitbake_patching_started" in result.output, msg = "Repository has been reinitialized. {}".format(srcdir))
|
||||
self.delete_recipeinc(test_recipe)
|
||||
bitbake('-cclean {}'.format(test_recipe))
|
||||
|
||||
|
||||
def test_git_unpack_nonetwork(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user