aboutsummaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-09-03 22:22:10 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2009-09-03 22:22:10 +0100
commit43fa53c9f3933391a323d4bc6d26b88b750bafeb (patch)
tree891a8710080e86f595edb776f4fd2f47fbd7166d /meta
parent0deeea4f9003177a1b64bb505a405d6367869e49 (diff)
downloadopenembedded-core-contrib-43fa53c9f3933391a323d4bc6d26b88b750bafeb.tar.gz
patch.bbclass: Merge in git resolver changes from OE.dev. Catch all exceptions rather than print horrid backtraces
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/patch.bbclass26
1 files changed, 21 insertions, 5 deletions
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
index 609e1a14158..ba0f19215d0 100644
--- a/meta/classes/patch.bbclass
+++ b/meta/classes/patch.bbclass
@@ -187,6 +187,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)
@@ -425,6 +443,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
@@ -451,6 +470,7 @@ python patch_do_patch() {
patchsetmap = {
"patch": PatchTree,
"quilt": QuiltTree,
+ "git": GitApplyTree,
}
cls = patchsetmap[bb.data.getVar('PATCHTOOL', d, 1) or 'quilt']
@@ -544,12 +564,8 @@ python patch_do_patch() {
bb.note("Applying patch '%s'" % pname)
try:
patchset.Import({"file":unpacked, "remote":url, "strippath": pnum}, True)
- except NotFoundError:
- import sys
- raise bb.build.FuncFailed(str(sys.exc_value))
- try:
resolver.Resolve()
- except PatchError:
+ except:
import sys
raise bb.build.FuncFailed(str(sys.exc_value))
}