summaryrefslogtreecommitdiff
path: root/classes/patch.bbclass
diff options
context:
space:
mode:
authorRod Whitby <rod@whitby.id.au>2006-08-30 07:46:16 +0000
committerRod Whitby <rod@whitby.id.au>2006-08-30 07:46:16 +0000
commit1780fd7ecd3d50ddcf86f03a648a489181f94bf2 (patch)
tree8fe7e1ea8c3572d97757b7049506b6ef8a5d6d75 /classes/patch.bbclass
parent63734615258cef5f575738a88884ef4523120a51 (diff)
parent41a995084316c3f0092a85a9047751ffb82b02bc (diff)
merge of 18b9ec04d7f267ce07ff8f28fbbe478a75728854
and 7ff3301c1054623d64c67d368c1997f39db2939f
Diffstat (limited to 'classes/patch.bbclass')
-rw-r--r--classes/patch.bbclass26
1 files changed, 18 insertions, 8 deletions
diff --git a/classes/patch.bbclass b/classes/patch.bbclass
index ea0182484e..7bb0900f8a 100644
--- a/classes/patch.bbclass
+++ b/classes/patch.bbclass
@@ -174,6 +174,9 @@ 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.mkdir(p)
def Clean(self):
try:
@@ -306,6 +309,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 +373,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 +403,7 @@ python patch_do_patch() {
cls = patchsetmap[bb.data.getVar('PATCHTOOL', d, 1) or 'quilt']
resolvermap = {
+ "noop": NOOPResolver,
"user": UserResolver,
}