* [PATCH 0/2] Terminal fixes
@ 2015-02-25 11:22 Paul Eggleton
2015-02-25 11:22 ` [PATCH 1/2] lib/oe/terminal: fix regressions Paul Eggleton
2015-02-25 11:22 ` [PATCH 2/2] lib/oe/terminal: fix konsole terminal support for KDE 4.x Paul Eggleton
0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2015-02-25 11:22 UTC (permalink / raw)
To: openembedded-core
Fix up some regressions and Konsole 2.x+ support. The Konsole patch can
be left until M4 if we want to be conservative.
These were tested with both old and new versions of konsole and
gnome-terminal.
The following changes since commit c578f5d34ce1718aaeb7dcbf3fc014fd48bac5fc:
build-appliance-image: Update to master head revision (2015-02-24 23:37:49 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/terminal
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/terminal
Paul Eggleton (2):
lib/oe/terminal: fix regressions
lib/oe/terminal: fix konsole terminal support for KDE 4.x
meta/lib/oe/terminal.py | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
--
1.9.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] lib/oe/terminal: fix regressions
2015-02-25 11:22 [PATCH 0/2] Terminal fixes Paul Eggleton
@ 2015-02-25 11:22 ` Paul Eggleton
2015-02-25 11:22 ` [PATCH 2/2] lib/oe/terminal: fix konsole terminal support for KDE 4.x Paul Eggleton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2015-02-25 11:22 UTC (permalink / raw)
To: openembedded-core
Fix up some issues introduced by OE-Core commit
818c94f5b9882c2028ef9f056714a0a3c9045551:
* If we want to support versions with more than two parts, versions with
only one part, or versions with non-integer parts, then we have to
stay with strings. We can use distutils.version.LooseVersion() to help
with comparisons.
* We don't want a warning when launching gnome-terminal 3.10+ and
logger.warn() doesn't take a first integer parameter anyway
(logger.debug() does).
* Also clean up tabs.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/lib/oe/terminal.py | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 01c0ccc..fdfdde2 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -2,6 +2,7 @@ import logging
import oe.classutils
import shlex
from bb.process import Popen, ExecutionError
+from distutils.version import LooseVersion
logger = logging.getLogger('BitBake.OE.Terminal')
@@ -57,9 +58,9 @@ class Gnome(XTerminal):
def __init__(self, sh_cmd, title=None, env=None, d=None):
# Check version
- (major, minor) = check_terminal_version("gnome-terminal")
- if major >= 3 and minor >= 10:
- logger.warn(1, 'Gnome-Terminal >3.10 does not support --disable-factory')
+ vernum = check_terminal_version("gnome-terminal")
+ if vernum and LooseVersion(vernum) >= '3.10':
+ logger.debug(1, 'Gnome-Terminal 3.10 or later does not support --disable-factory')
self.command = 'gnome-terminal -t "{title}" -x {command}'
XTerminal.__init__(self, sh_cmd, title, env, d)
@@ -81,8 +82,8 @@ class Konsole(XTerminal):
def __init__(self, sh_cmd, title=None, env=None, d=None):
# Check version
- (major, minor) = check_terminal_version("konsole")
- if major == 2:
+ vernum = check_terminal_version("konsole")
+ if vernum and LooseVersion(vernum) >= '2.0.0':
logger.debug(1, 'Konsole from KDE 4.x will not work as devshell, skipping')
raise UnsupportedTerminal(self.name)
XTerminal.__init__(self, sh_cmd, title, env, d)
@@ -239,17 +240,12 @@ def check_terminal_version(terminalName):
else:
raise
vernum = None
- major = int(0)
- minor = int(0)
for ver in ver_info:
if ver.startswith('Konsole'):
vernum = ver.split(' ')[-1]
- if ver.startswith('GNOME Terminal'):
+ if ver.startswith('GNOME Terminal'):
vernum = ver.split(' ')[-1]
- if vernum:
- major = int(vernum.split('.')[0])
- minor = int(vernum.split('.')[1])
- return major, minor
+ return vernum
def distro_name():
try:
--
1.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] lib/oe/terminal: fix konsole terminal support for KDE 4.x
2015-02-25 11:22 [PATCH 0/2] Terminal fixes Paul Eggleton
2015-02-25 11:22 ` [PATCH 1/2] lib/oe/terminal: fix regressions Paul Eggleton
@ 2015-02-25 11:22 ` Paul Eggleton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2015-02-25 11:22 UTC (permalink / raw)
To: openembedded-core
It seems that the --nofork option genuinely stops konsole from going
into the background now; I'm not sure when this changed but it does seem
to be working so we can use it. (Tested with Konsole 2.10 and 2.14.2).
Fixes [YOCTO #4934].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/lib/oe/terminal.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index fdfdde2..4f5c611 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -77,15 +77,15 @@ class Terminology(XTerminal):
priority = 2
class Konsole(XTerminal):
- command = 'konsole -T "{title}" -e {command}'
+ command = 'konsole --nofork -p tabtitle="{title}" -e {command}'
priority = 2
def __init__(self, sh_cmd, title=None, env=None, d=None):
# Check version
vernum = check_terminal_version("konsole")
- if vernum and LooseVersion(vernum) >= '2.0.0':
- logger.debug(1, 'Konsole from KDE 4.x will not work as devshell, skipping')
- raise UnsupportedTerminal(self.name)
+ if vernum and LooseVersion(vernum) < '2.0.0':
+ # Konsole from KDE 3.x
+ self.command = 'konsole -T "{title}" -e {command}'
XTerminal.__init__(self, sh_cmd, title, env, d)
class XTerm(XTerminal):
--
1.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-25 11:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25 11:22 [PATCH 0/2] Terminal fixes Paul Eggleton
2015-02-25 11:22 ` [PATCH 1/2] lib/oe/terminal: fix regressions Paul Eggleton
2015-02-25 11:22 ` [PATCH 2/2] lib/oe/terminal: fix konsole terminal support for KDE 4.x Paul Eggleton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox