]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oe/patch: fall back to patch if git apply fails
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 19 Dec 2014 11:41:45 +0000 (11:41 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 21 Dec 2014 12:37:18 +0000 (12:37 +0000)
When PATCHTOOL = "git", git apply doesn't support fuzzy application, so
if a patch requires that it's better to be able to apply it rather than
just failing.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/patch.py

index b085c9d6b538aaf6b22735c57617e1fad0adc253..788f465bd99d1209f58fb692e2f6cbafddb17e59 100644 (file)
@@ -219,7 +219,11 @@ class GitApplyTree(PatchTree):
             return _applypatchhelper(shellcmd, patch, force, reverse, run)
         except CmdError:
             shellcmd = ["git", "--git-dir=.", "apply", "-p%s" % patch['strippath']]
-            return _applypatchhelper(shellcmd, patch, force, reverse, run)
+            try:
+                output = _applypatchhelper(shellcmd, patch, force, reverse, run)
+            except CmdError:
+                output = PatchTree._applypatch(self, patch, force, reverse, run)
+            return output
 
 
 class QuiltTree(PatchSet):