oe.patch.GitApplyTree: add paths argument to extractPatches

Makes it possible to define which paths are included in the patches.

(From OE-Core rev: 640e57b423e5a8f0e4572eac985f87139780f247)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Markus Lehtonen 2015-04-23 15:41:04 +03:00 committed by Richard Purdie
parent d5e2dd47db
commit 31c3078a63
1 changed files with 4 additions and 1 deletions

View File

@ -337,12 +337,15 @@ class GitApplyTree(PatchTree):
return (tmpfile, cmd)
@staticmethod
def extractPatches(tree, startcommit, outdir):
def extractPatches(tree, startcommit, outdir, paths=None):
import tempfile
import shutil
tempdir = tempfile.mkdtemp(prefix='oepatch')
try:
shellcmd = ["git", "format-patch", startcommit, "-o", tempdir]
if paths:
shellcmd.append('--')
shellcmd.extend(paths)
out = runcmd(["sh", "-c", " ".join(shellcmd)], tree)
if out:
for srcfile in out.split():