summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-25 16:08:26 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-08 13:07:15 +0100
commit33973cd841803dbe0d917897d2e4985baee47232 (patch)
tree49b814397a310b219161fa0ce95490bead7fe772 /meta
parentcfb195ae80dc78dda009dd7dc932172ce8cc917f (diff)
downloadpoky-33973cd841803dbe0d917897d2e4985baee47232.tar.gz
lib/oe/patch: Fix git patch application for source in subdirectory
Similarly to: http://git.yoctoproject.org/cgit.cgi/poky/commit/meta/lib/oe/patch.py?id=f205ccaf48ac36f4b26efc4aeb2e9d2939b28646 we need to fix patch application for source which is in a subdirectory. Passing "." as the git directory or work-dir appears to work (or is ignored) in some versions of git but does not work in others, probably quite correctly. Since we have reporoot from the above patch, pass this in directly. This bug caused this sanity test failure on some machines: FAIL: test_devtool_modify_git (oeqa.selftest.devtool.DevtoolTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/devtool.py", line 390, in test_devtool_modify_git self.assertEqual(result.output.strip(), "", 'Created git repo is not clean') AssertionError: '?? util/mkelfImage/patches/' != '' : Created git repo is not clean since git apply would fail, it would then fall back to quilt and the git tree would be left unclean. [YOCTO #7911] (From OE-Core rev: 91d76e632336d6af96f24bcf92be25f41a216856) (From OE-Core rev: e35e40c95a067376634d7b019f4c1d3db724ceae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/patch.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index f68d40f8c8..6b41dc6d12 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -334,17 +334,17 @@ class GitApplyTree(PatchTree):
334 try: 334 try:
335 patchfilevar = 'PATCHFILE="%s"' % os.path.basename(patch['file']) 335 patchfilevar = 'PATCHFILE="%s"' % os.path.basename(patch['file'])
336 try: 336 try:
337 shellcmd = [patchfilevar, "git", "--work-tree=.", "am", "-3", "--keep-cr", "-p%s" % patch['strippath']] 337 shellcmd = [patchfilevar, "git", "--work-tree=%s" % reporoot, "am", "-3", "--keep-cr", "-p%s" % patch['strippath']]
338 return _applypatchhelper(shellcmd, patch, force, reverse, run) 338 return _applypatchhelper(shellcmd, patch, force, reverse, run)
339 except CmdError: 339 except CmdError:
340 # Need to abort the git am, or we'll still be within it at the end 340 # Need to abort the git am, or we'll still be within it at the end
341 try: 341 try:
342 shellcmd = ["git", "--work-tree=.", "am", "--abort"] 342 shellcmd = ["git", "--work-tree=%s" % reporoot, "am", "--abort"]
343 runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) 343 runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
344 except CmdError: 344 except CmdError:
345 pass 345 pass
346 # Fall back to git apply 346 # Fall back to git apply
347 shellcmd = ["git", "--git-dir=.", "apply", "-p%s" % patch['strippath']] 347 shellcmd = ["git", "--git-dir=%s" % reporoot, "apply", "-p%s" % patch['strippath']]
348 try: 348 try:
349 output = _applypatchhelper(shellcmd, patch, force, reverse, run) 349 output = _applypatchhelper(shellcmd, patch, force, reverse, run)
350 except CmdError: 350 except CmdError: