diff options
author | Kristoffer Ericson <kristoffer_e1@hotmail.com> | 2006-09-03 22:45:25 +0000 |
---|---|---|
committer | Kristoffer Ericson <kristoffer_e1@hotmail.com> | 2006-09-03 22:45:25 +0000 |
commit | 260069845a847938bf587583a9d36ec18f533c50 (patch) | |
tree | 84324e4c5d5ea1148c2c293e8a6547d8d7403179 /classes | |
parent | 88ddfa8fba208fc9c874480f9a8889bd65225e43 (diff) | |
parent | d5920d9869e2c5d3ef23242537b09664b2144bfc (diff) |
merge of 43de53f09816b4e1e243912e5958a66424c605f8
and ae090523c163ff0d1e234b0d89d1450a2466b4b4
Diffstat (limited to 'classes')
-rw-r--r-- | classes/patch.bbclass | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/classes/patch.bbclass b/classes/patch.bbclass index ea0182484e..5e40b3dc0d 100644 --- a/classes/patch.bbclass +++ b/classes/patch.bbclass @@ -174,15 +174,15 @@ def patch_init(d): def __init__(self, dir, d): PatchSet.__init__(self, dir, d) self.initialized = False + p = os.path.join(self.dir, 'patches') + if not os.path.exists(p): + os.makedirs(p) def Clean(self): try: self._runcmd(["pop", "-a", "-f"]) - except CmdError: - pass - except NotFoundError: + except Exception: pass - # runcmd(["rm", "-rf", os.path.join(self.dir, "patches"), os.path.join(self.dir, ".pc")]) self.initialized = True def InitFromDir(self): @@ -306,6 +306,19 @@ def patch_init(d): def Finalize(self): raise NotImplementedError() + class NOOPResolver(Resolver): + def __init__(self, patchset): + self.patchset = patchset + + def Resolve(self): + olddir = os.path.abspath(os.curdir) + os.chdir(self.patchset.dir) + try: + self.patchset.Push() + except Exception: + os.chdir(olddir) + raise sys.exc_value + # Patch resolver which relies on the user doing all the work involved in the # resolution, with the exception of refreshing the remote copy of the patch # files (the urls). @@ -357,20 +370,13 @@ def patch_init(d): raise os.chdir(olddir) - # Throw away the changes to the patches in the patchset made by resolve() - def Revert(self): - raise NotImplementedError() - - # Apply the changes to the patches in the patchset made by resolve() - def Finalize(self): - raise NotImplementedError() - g = globals() g["PatchSet"] = PatchSet g["PatchTree"] = PatchTree g["QuiltTree"] = QuiltTree g["Resolver"] = Resolver g["UserResolver"] = UserResolver + g["NOOPResolver"] = NOOPResolver g["NotFoundError"] = NotFoundError g["CmdError"] = CmdError @@ -394,6 +400,7 @@ python patch_do_patch() { cls = patchsetmap[bb.data.getVar('PATCHTOOL', d, 1) or 'quilt'] resolvermap = { + "noop": NOOPResolver, "user": UserResolver, } |