summaryrefslogtreecommitdiff
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-03 22:00:55 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-04 17:04:32 +0000
commit9e0a21dda24f285a1c4878488e887485a749f3f2 (patch)
tree198e762d199b9007756f3043a785d4ea1618496b /meta/lib
parent08b78066bd5a9ff2819a42eb4263ee0a78cddb97 (diff)
downloadopenembedded-core-9e0a21dda24f285a1c4878488e887485a749f3f2.tar.gz
openembedded-core-9e0a21dda24f285a1c4878488e887485a749f3f2.tar.bz2
openembedded-core-9e0a21dda24f285a1c4878488e887485a749f3f2.tar.xz
openembedded-core-9e0a21dda24f285a1c4878488e887485a749f3f2.zip
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] 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 9768be077..75fb91e0f 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -311,7 +311,7 @@ class QuiltTree(PatchSet):
self._runcmd(args)
class Resolver(object):
- def __init__(self, patchset):
+ def __init__(self, patchset, terminal):
raise NotImplementedError()
def Resolve(self):
@@ -324,8 +324,9 @@ class Resolver(object):
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)
@@ -341,13 +342,13 @@ class NOOPResolver(Resolver):
# 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:
@@ -368,16 +369,10 @@ class UserResolver(Resolver):
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