summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/patch.bbclass4
-rw-r--r--meta/lib/oe/patch.py17
2 files changed, 9 insertions, 12 deletions
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
index 762216345a..86046e1ff8 100644
--- a/meta/classes/patch.bbclass
+++ b/meta/classes/patch.bbclass
@@ -5,6 +5,8 @@ QUILTRCFILE ?= "${STAGING_BINDIR_NATIVE}/quiltrc"
5 5
6PATCHDEPENDENCY = "${PATCHTOOL}-native:do_populate_sysroot" 6PATCHDEPENDENCY = "${PATCHTOOL}-native:do_populate_sysroot"
7 7
8inherit terminal
9
8python patch_do_patch() { 10python patch_do_patch() {
9 import oe.patch 11 import oe.patch
10 12
@@ -124,7 +126,7 @@ python patch_do_patch() {
124 126
125 if not patchdir in classes: 127 if not patchdir in classes:
126 patchset = cls(patchdir, d) 128 patchset = cls(patchdir, d)
127 resolver = rcls(patchset) 129 resolver = rcls(patchset, oe_terminal)
128 classes[patchdir] = (patchset, resolver) 130 classes[patchdir] = (patchset, resolver)
129 patchset.Clean() 131 patchset.Clean()
130 else: 132 else:
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 9768be077f..75fb91e0fb 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