summaryrefslogtreecommitdiff
path: root/classes/patch.bbclass
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2006-08-30 07:29:56 +0000
committerChris Larson <clarson@kergoth.com>2006-08-30 07:29:56 +0000
commitdc8d0a5f1ea8956bc4af88132472cccde4a0e7c3 (patch)
treec1641eb453dfb7eec84046a373d37dd51d1cb1b6 /classes/patch.bbclass
parent4b58334866dda9b3415fee5668b2c7bc08447905 (diff)
patch.bbclass:
* Add NOOPResolver class, which simply passes the patch failure on up, not doing any actual patch resolution. Set PATCHRESOLVE = "noop" to make use of it. Most useful for unattended builds.
Diffstat (limited to 'classes/patch.bbclass')
-rw-r--r--classes/patch.bbclass23
1 files changed, 15 insertions, 8 deletions
diff --git a/classes/patch.bbclass b/classes/patch.bbclass
index c62a8ebd76..7bb0900f8a 100644
--- a/classes/patch.bbclass
+++ b/classes/patch.bbclass
@@ -309,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).
@@ -360,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
@@ -397,6 +403,7 @@ python patch_do_patch() {
cls = patchsetmap[bb.data.getVar('PATCHTOOL', d, 1) or 'quilt']
resolvermap = {
+ "noop": NOOPResolver,
"user": UserResolver,
}