summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/bbtests.py
diff options
context:
space:
mode:
authorPavel Zhukov <pavel.zhukov@huawei.com>2021-12-02 08:56:04 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-03 23:37:16 +0000
commitae57c83f03247b5149c94ae8e8fc25d6ad27dc02 (patch)
treea453f8e0d296c67bfa294fa18a04da1e90c1dfb5 /meta/lib/oeqa/selftest/cases/bbtests.py
parentb1984dd2f5096fca7b7a8b93a45143825b168bda (diff)
downloadpoky-ae57c83f03247b5149c94ae8e8fc25d6ad27dc02.tar.gz
patch.py: Initialize git repo before patching
If PATCHTOOL="git" has been specified but workdir is not git repo bitbake fails to apply the patches with error message: Command Error: 'git rev-parse --show-toplevel' exited with 0 Output: fatal: not a git repository (or any of the parent directories): .git Fix this by initializing the repo before patching. This allows binary git patches to be applied. (From OE-Core rev: 6184b56a7a0fc6f5d19fdfb81e7453667f7da940) Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/bbtests.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/bbtests.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/bbtests.py b/meta/lib/oeqa/selftest/cases/bbtests.py
index 6779e62103..a74576bc02 100644
--- a/meta/lib/oeqa/selftest/cases/bbtests.py
+++ b/meta/lib/oeqa/selftest/cases/bbtests.py
@@ -297,3 +297,18 @@ INHERIT:remove = \"report-error\"
297 297
298 test_recipe_summary_after = get_bb_var('SUMMARY', test_recipe) 298 test_recipe_summary_after = get_bb_var('SUMMARY', test_recipe)
299 self.assertEqual(expected_recipe_summary, test_recipe_summary_after) 299 self.assertEqual(expected_recipe_summary, test_recipe_summary_after)
300
301 def test_git_patchtool(self):
302 """ PATCHTOOL=git should work with non-git sources like tarballs
303 test recipe for the test must NOT containt git:// repository in SRC_URI
304 """
305 test_recipe = "man-db"
306 self.write_recipeinc(test_recipe, 'PATCHTOOL=\"git\"')
307 src = get_bb_var("SRC_URI",test_recipe)
308 gitscm = re.search("git://", src)
309 self.assertFalse(gitscm, "test_git_patchtool pre-condition failed: {} test recipe contains git repo!".format(test_recipe))
310 result = bitbake('man-db -c patch', ignore_status=False)
311 fatal = re.search("fatal: not a git repository (or any of the parent directories)", result.output)
312 self.assertFalse(fatal, "Failed to patch using PATCHTOOL=\"git\"")
313 self.delete_recipeinc(test_recipe)
314 bitbake('-cclean man-db')