* [PATCH] terminal.py: No --disable-factory for gnome-terminal >= 3.10
@ 2015-02-21 10:44 Sven Ebenfeld
2015-02-23 13:30 ` Burton, Ross
2015-02-23 13:34 ` Burton, Ross
0 siblings, 2 replies; 4+ messages in thread
From: Sven Ebenfeld @ 2015-02-21 10:44 UTC (permalink / raw)
To: openembedded-core
--disable-factory has been disabled in earlier versions of gnome-terminal
but from version 3.10 it raises an error and quits. This makes devshell
unusable with gnome-terminal >= 3.10. This patch checks for the version and
removes --disable-factory if you have the terminal version 3.10 or higher.
Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
---
meta/lib/oe/terminal.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 54e3ffc..a02638f 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -55,6 +55,17 @@ class Gnome(XTerminal):
command = 'gnome-terminal -t "{title}" --disable-factory -x {command}'
priority = 2
+ def __init__(self, sh_cmd, title=None, env=None, d=None):
+ # Check version
+ vernum = check_konsole_version("gnome-terminal")
+ if vernum:
+ major = int(vernum.split('.')[0])
+ minor = int(vernum.split('.')[1])
+ if major >= 3 and minor >= 10:
+ logger.warn(1, 'Gnome-Terminal >3.10 does not support --disable-factory')
+ self.command = 'gnome-terminal -t "{title}" -x {command}'
+ XTerminal.__init__(self, sh_cmd, title, env, d)
+
class Mate(XTerminal):
command = 'mate-terminal -t "{title}" -x {command}'
priority = 2
@@ -235,6 +246,8 @@ def check_konsole_version(konsole):
for ver in ver_info:
if ver.startswith('Konsole'):
vernum = ver.split(' ')[-1]
+ if ver.startswith('GNOME Terminal'):
+ vernum = ver.split(' ')[-1]
return vernum
def distro_name():
--
1.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] terminal.py: No --disable-factory for gnome-terminal >= 3.10
2015-02-21 10:44 [PATCH] terminal.py: No --disable-factory for gnome-terminal >= 3.10 Sven Ebenfeld
@ 2015-02-23 13:30 ` Burton, Ross
2015-02-23 13:34 ` Burton, Ross
1 sibling, 0 replies; 4+ messages in thread
From: Burton, Ross @ 2015-02-23 13:30 UTC (permalink / raw)
To: Sven Ebenfeld; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 265 bytes --]
Hi Sven,
On 21 February 2015 at 10:44, Sven Ebenfeld <sven.ebenfeld@gmail.com> wrote:
> @@ -235,6 +246,8 @@ def check_konsole_version(konsole):
>
Can you rename check_konsole_version to something generic such as
check_terminal_version?
Cheers,
Ross
[-- Attachment #2: Type: text/html, Size: 730 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] terminal.py: No --disable-factory for gnome-terminal >= 3.10
2015-02-21 10:44 [PATCH] terminal.py: No --disable-factory for gnome-terminal >= 3.10 Sven Ebenfeld
2015-02-23 13:30 ` Burton, Ross
@ 2015-02-23 13:34 ` Burton, Ross
2015-02-23 19:41 ` Sven Ebenfeld
1 sibling, 1 reply; 4+ messages in thread
From: Burton, Ross @ 2015-02-23 13:34 UTC (permalink / raw)
To: Sven Ebenfeld; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 547 bytes --]
Hi again,
On 21 February 2015 at 10:44, Sven Ebenfeld <sven.ebenfeld@gmail.com> wrote:
> + vernum = check_konsole_version("gnome-terminal")
> + if vernum:
> + major = int(vernum.split('.')[0])
> + minor = int(vernum.split('.')[1])
>
And whilst you're editing this code, doing the split inside
check_terminal_version and returning a tuple would clean it up nicely:
def get_terminal_version():
...
return ver.split()[-1].split('.')[:2]
(major, minor) = get_terminal_version()
Ross
[-- Attachment #2: Type: text/html, Size: 1196 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] terminal.py: No --disable-factory for gnome-terminal >= 3.10
2015-02-23 13:34 ` Burton, Ross
@ 2015-02-23 19:41 ` Sven Ebenfeld
0 siblings, 0 replies; 4+ messages in thread
From: Sven Ebenfeld @ 2015-02-23 19:41 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
Hi Ross,
Thank you for your replies!
I've reworked my patch and submitted it again.
Cheers,
Sven
Am 23.02.2015 um 14:34 schrieb Burton, Ross:
> Hi again,
>
> On 21 February 2015 at 10:44, Sven Ebenfeld <sven.ebenfeld@gmail.com> wrote:
>
>> + vernum = check_konsole_version("gnome-terminal")
>> + if vernum:
>> + major = int(vernum.split('.')[0])
>> + minor = int(vernum.split('.')[1])
>>
>
> And whilst you're editing this code, doing the split inside
> check_terminal_version and returning a tuple would clean it up nicely:
>
> def get_terminal_version():
> ...
> return ver.split()[-1].split('.')[:2]
> (major, minor) = get_terminal_version()
>
> Ross
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-23 19:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-21 10:44 [PATCH] terminal.py: No --disable-factory for gnome-terminal >= 3.10 Sven Ebenfeld
2015-02-23 13:30 ` Burton, Ross
2015-02-23 13:34 ` Burton, Ross
2015-02-23 19:41 ` Sven Ebenfeld
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox