PATCHDEPENDENCY = "${PATCHTOOL}-native:do_populate_sysroot"
+inherit terminal
+
python patch_do_patch() {
import oe.patch
if not patchdir in classes:
patchset = cls(patchdir, d)
- resolver = rcls(patchset)
+ resolver = rcls(patchset, oe_terminal)
classes[patchdir] = (patchset, resolver)
patchset.Clean()
else:
self._runcmd(args)
class Resolver(object):
- def __init__(self, patchset):
+ def __init__(self, patchset, terminal):
raise NotImplementedError()
def Resolve(self):
raise NotImplementedError()
class NOOPResolver(Resolver):
- def __init__(self, patchset):
+ def __init__(self, patchset, terminal):
self.patchset = patchset
+ self.terminal = terminal
def Resolve(self):
olddir = os.path.abspath(os.curdir)
# resolution, with the exception of refreshing the remote copy of the patch
# files (the urls).
class UserResolver(Resolver):
- def __init__(self, patchset):
+ def __init__(self, patchset, terminal):
self.patchset = patchset
+ self.terminal = terminal
# Force a push in the patchset, then drop to a shell for the user to
# resolve any rejected hunks
def Resolve(self):
-
olddir = os.path.abspath(os.curdir)
os.chdir(self.patchset.dir)
try:
f.write("echo 'Run \"quilt refresh\" when patch is corrected, press CTRL+D to exit.'\n")
f.write("echo ''\n")
f.write(" ".join(patchcmd) + "\n")
- f.write("#" + bb.data.getVar('TERMCMDRUN', self.patchset.d, 1))
f.close()
os.chmod(rcfile, 0775)
- os.environ['TERMWINDOWTITLE'] = "Bitbake: Please fix patch rejects manually"
- os.environ['SHELLCMDS'] = "bash --rcfile " + rcfile
- rc = os.system(bb.data.getVar('TERMCMDRUN', self.patchset.d, 1))
- if os.WIFEXITED(rc) and os.WEXITSTATUS(rc) != 0:
- bb.msg.fatal("Build", ("Cannot proceed with manual patch resolution - '%s' not found. " \
- + "Check TERMCMDRUN variable.") % bb.data.getVar('TERMCMDRUN', self.patchset.d, 1))
+ self.terminal("bash --rcfile " + rcfile, 'Patch Rejects: Please fix patch rejects manually', self.patchset.d)
# Construct a new PatchSet after the user's changes, compare the
# sets, checking patches for modifications, and doing a remote