summaryrefslogtreecommitdiffstats
path: root/meta/classes/patch.bbclass
diff options
context:
space:
mode:
authorChris Larson <kergoth@openedhand.com>2006-08-30 07:25:59 +0000
committerChris Larson <kergoth@openedhand.com>2006-08-30 07:25:59 +0000
commit874a642961a20ef757bb5ed920247b1415e84fed (patch)
treed708967df2989289f06256cb621c1ce351e15cef /meta/classes/patch.bbclass
parent015306454ca0ef4e46493dd90c8002103abfa5fd (diff)
downloadpoky-874a642961a20ef757bb5ed920247b1415e84fed.tar.gz
Patch.bbclass: add NOOPResolver class for use in unattended builds, which does no actual patch resolution, simply passing the failure on up. Set PATCHRESOLVE='noop' to make use of it. Also pulls in the workaround for quilt's upward searching for a 'patches' dir from upstream oe.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@680 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/patch.bbclass')
-rw-r--r--meta/classes/patch.bbclass26
1 files changed, 18 insertions, 8 deletions
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
index ea0182484e..7bb0900f8a 100644
--- a/meta/classes/patch.bbclass
+++ b/meta/classes/patch.bbclass
@@ -174,6 +174,9 @@ def patch_init(d):
174 def __init__(self, dir, d): 174 def __init__(self, dir, d):
175 PatchSet.__init__(self, dir, d) 175 PatchSet.__init__(self, dir, d)
176 self.initialized = False 176 self.initialized = False
177 p = os.path.join(self.dir, 'patches')
178 if not os.path.exists(p):
179 os.mkdir(p)
177 180
178 def Clean(self): 181 def Clean(self):
179 try: 182 try:
@@ -306,6 +309,19 @@ def patch_init(d):
306 def Finalize(self): 309 def Finalize(self):
307 raise NotImplementedError() 310 raise NotImplementedError()
308 311
312 class NOOPResolver(Resolver):
313 def __init__(self, patchset):
314 self.patchset = patchset
315
316 def Resolve(self):
317 olddir = os.path.abspath(os.curdir)
318 os.chdir(self.patchset.dir)
319 try:
320 self.patchset.Push()
321 except Exception:
322 os.chdir(olddir)
323 raise sys.exc_value
324
309 # Patch resolver which relies on the user doing all the work involved in the 325 # Patch resolver which relies on the user doing all the work involved in the
310 # resolution, with the exception of refreshing the remote copy of the patch 326 # resolution, with the exception of refreshing the remote copy of the patch
311 # files (the urls). 327 # files (the urls).
@@ -357,20 +373,13 @@ def patch_init(d):
357 raise 373 raise
358 os.chdir(olddir) 374 os.chdir(olddir)
359 375
360 # Throw away the changes to the patches in the patchset made by resolve()
361 def Revert(self):
362 raise NotImplementedError()
363
364 # Apply the changes to the patches in the patchset made by resolve()
365 def Finalize(self):
366 raise NotImplementedError()
367
368 g = globals() 376 g = globals()
369 g["PatchSet"] = PatchSet 377 g["PatchSet"] = PatchSet
370 g["PatchTree"] = PatchTree 378 g["PatchTree"] = PatchTree
371 g["QuiltTree"] = QuiltTree 379 g["QuiltTree"] = QuiltTree
372 g["Resolver"] = Resolver 380 g["Resolver"] = Resolver
373 g["UserResolver"] = UserResolver 381 g["UserResolver"] = UserResolver
382 g["NOOPResolver"] = NOOPResolver
374 g["NotFoundError"] = NotFoundError 383 g["NotFoundError"] = NotFoundError
375 g["CmdError"] = CmdError 384 g["CmdError"] = CmdError
376 385
@@ -394,6 +403,7 @@ python patch_do_patch() {
394 cls = patchsetmap[bb.data.getVar('PATCHTOOL', d, 1) or 'quilt'] 403 cls = patchsetmap[bb.data.getVar('PATCHTOOL', d, 1) or 'quilt']
395 404
396 resolvermap = { 405 resolvermap = {
406 "noop": NOOPResolver,
397 "user": UserResolver, 407 "user": UserResolver,
398 } 408 }
399 409