summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-03 22:00:55 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-04 17:05:32 (GMT)
commit9d1f10ed012de6976141a29ba483e0b96781fe28 (patch)
tree9f49f1c01bb2d97aa000aaa50019ad471207450d /meta/lib
parent3b856e1cdf38705f1ae79df09e7e6f388673a683 (diff)
downloadpoky-9d1f10ed012de6976141a29ba483e0b96781fe28.tar.gz
patch: Convert to use oe_terminal
Unfortunately we can't access oe_terminal directly from patch.py so we have to pass in the correct terminal function pointer. [YOCTO #1587] (From OE-Core rev: 9e0a21dda24f285a1c4878488e887485a749f3f2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/patch.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 9768be0..75fb91e 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -311,7 +311,7 @@ class QuiltTree(PatchSet):
311 self._runcmd(args) 311 self._runcmd(args)
312 312
313class Resolver(object): 313class Resolver(object):
314 def __init__(self, patchset): 314 def __init__(self, patchset, terminal):
315 raise NotImplementedError() 315 raise NotImplementedError()
316 316
317 def Resolve(self): 317 def Resolve(self):
@@ -324,8 +324,9 @@ class Resolver(object):
324 raise NotImplementedError() 324 raise NotImplementedError()
325 325
326class NOOPResolver(Resolver): 326class NOOPResolver(Resolver):
327 def __init__(self, patchset): 327 def __init__(self, patchset, terminal):
328 self.patchset = patchset 328 self.patchset = patchset
329 self.terminal = terminal
329 330
330 def Resolve(self): 331 def Resolve(self):
331 olddir = os.path.abspath(os.curdir) 332 olddir = os.path.abspath(os.curdir)
@@ -341,13 +342,13 @@ class NOOPResolver(Resolver):
341# resolution, with the exception of refreshing the remote copy of the patch 342# resolution, with the exception of refreshing the remote copy of the patch
342# files (the urls). 343# files (the urls).
343class UserResolver(Resolver): 344class UserResolver(Resolver):
344 def __init__(self, patchset): 345 def __init__(self, patchset, terminal):
345 self.patchset = patchset 346 self.patchset = patchset
347 self.terminal = terminal
346 348
347 # Force a push in the patchset, then drop to a shell for the user to 349 # Force a push in the patchset, then drop to a shell for the user to
348 # resolve any rejected hunks 350 # resolve any rejected hunks
349 def Resolve(self): 351 def Resolve(self):
350
351 olddir = os.path.abspath(os.curdir) 352 olddir = os.path.abspath(os.curdir)
352 os.chdir(self.patchset.dir) 353 os.chdir(self.patchset.dir)
353 try: 354 try:
@@ -368,16 +369,10 @@ class UserResolver(Resolver):
368 f.write("echo 'Run \"quilt refresh\" when patch is corrected, press CTRL+D to exit.'\n") 369 f.write("echo 'Run \"quilt refresh\" when patch is corrected, press CTRL+D to exit.'\n")
369 f.write("echo ''\n") 370 f.write("echo ''\n")
370 f.write(" ".join(patchcmd) + "\n") 371 f.write(" ".join(patchcmd) + "\n")
371 f.write("#" + bb.data.getVar('TERMCMDRUN', self.patchset.d, 1))
372 f.close() 372 f.close()
373 os.chmod(rcfile, 0775) 373 os.chmod(rcfile, 0775)
374 374
375 os.environ['TERMWINDOWTITLE'] = "Bitbake: Please fix patch rejects manually" 375 self.terminal("bash --rcfile " + rcfile, 'Patch Rejects: Please fix patch rejects manually', self.patchset.d)
376 os.environ['SHELLCMDS'] = "bash --rcfile " + rcfile
377 rc = os.system(bb.data.getVar('TERMCMDRUN', self.patchset.d, 1))
378 if os.WIFEXITED(rc) and os.WEXITSTATUS(rc) != 0:
379 bb.msg.fatal("Build", ("Cannot proceed with manual patch resolution - '%s' not found. " \
380 + "Check TERMCMDRUN variable.") % bb.data.getVar('TERMCMDRUN', self.patchset.d, 1))
381 376
382 # Construct a new PatchSet after the user's changes, compare the 377 # Construct a new PatchSet after the user's changes, compare the
383 # sets, checking patches for modifications, and doing a remote 378 # sets, checking patches for modifications, and doing a remote