diff options
| author | Stefan Schmidt <stefan@datenfreihafen.org> | 2009-08-25 19:32:11 +0100 |
|---|---|---|
| committer | Stefan Schmidt <stefan@datenfreihafen.org> | 2009-08-25 19:32:11 +0100 |
| commit | efde023af7da8e638e67f1e4b755fe8d9e193371 (patch) | |
| tree | b150331f67be01bfdb249e8de4dc9fce7c908466 /classes/patch.bbclass | |
| parent | 064ef39c2964d51dfc44eb4e38c988744830a6d4 (diff) | |
| parent | 728dd524726daf2810bb383b89a17d035cda45e7 (diff) | |
Merge branch 'org.openembedded.dev' of git@git.openembedded.org:openembedded into org.openembedded.dev
Diffstat (limited to 'classes/patch.bbclass')
| -rw-r--r-- | classes/patch.bbclass | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/classes/patch.bbclass b/classes/patch.bbclass index 2f99e4cf30..dfb8ec960f 100644 --- a/classes/patch.bbclass +++ b/classes/patch.bbclass @@ -189,6 +189,24 @@ def patch_init(d): def Clean(self): """""" + class GitApplyTree(PatchTree): + def __init__(self, dir, d): + PatchTree.__init__(self, dir, d) + + def _applypatch(self, patch, force = False, reverse = False, run = True): + shellcmd = ["git", "--git-dir=.", "apply", "-p%s" % patch['strippath']] + + if reverse: + shellcmd.append('-R') + + shellcmd.append(patch['file']) + + if not run: + return "sh" + "-c" + " ".join(shellcmd) + + return runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) + + class QuiltTree(PatchSet): def _runcmd(self, args, run = True): quiltrc = bb.data.getVar('QUILTRCFILE', self.d, 1) @@ -424,6 +442,7 @@ def patch_init(d): g["PatchSet"] = PatchSet g["PatchTree"] = PatchTree g["QuiltTree"] = QuiltTree + g["GitApplyTree"] = GitApplyTree g["Resolver"] = Resolver g["UserResolver"] = UserResolver g["NOOPResolver"] = NOOPResolver @@ -449,6 +468,7 @@ python patch_do_patch() { patchsetmap = { "patch": PatchTree, "quilt": QuiltTree, + "git": GitApplyTree, } cls = patchsetmap[bb.data.getVar('PATCHTOOL', d, 1) or 'quilt'] |
