summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/patch.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/patch.py')
-rw-r--r--meta/lib/oe/patch.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 59abd0af19..b085c9d6b5 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -203,17 +203,23 @@ class GitApplyTree(PatchTree):
203 PatchTree.__init__(self, dir, d) 203 PatchTree.__init__(self, dir, d)
204 204
205 def _applypatch(self, patch, force = False, reverse = False, run = True): 205 def _applypatch(self, patch, force = False, reverse = False, run = True):
206 shellcmd = ["git", "--git-dir=.", "apply", "-p%s" % patch['strippath']] 206 def _applypatchhelper(shellcmd, patch, force = False, reverse = False, run = True):
207 if reverse:
208 shellcmd.append('-R')
207 209
208 if reverse: 210 shellcmd.append(patch['file'])
209 shellcmd.append('-R')
210 211
211 shellcmd.append(patch['file']) 212 if not run:
213 return "sh" + "-c" + " ".join(shellcmd)
212 214
213 if not run: 215 return runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
214 return "sh" + "-c" + " ".join(shellcmd)
215 216
216 return runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) 217 try:
218 shellcmd = ["git", "--work-tree=.", "am", "-3", "-p%s" % patch['strippath']]
219 return _applypatchhelper(shellcmd, patch, force, reverse, run)
220 except CmdError:
221 shellcmd = ["git", "--git-dir=.", "apply", "-p%s" % patch['strippath']]
222 return _applypatchhelper(shellcmd, patch, force, reverse, run)
217 223
218 224
219class QuiltTree(PatchSet): 225class QuiltTree(PatchSet):