Skip to contentSkip to conversation

Konsole handling

PATCH Applied Paul Eggleton 3 participants 6 messages Sep 16, 2011 – Sep 19, 2011

lore
Share & tools
lore
#0 lore raw

cover Konsole handling

The following changes since commit 20529035a4c0befb3c6bdbcb289a2de930fb143d:

bugzilla.bbclass: add a class to report build problems to bugzilla (2011-09-16 17:36:27 +0100)

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/konsole
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/konsole

Paul Eggleton (2):
lib/oe/terminal.py: declare konsole from KDE 4.x as unsupported sanity.bbclass: add a sanity check for KDE 4.x konsole in TERMCMD

 meta/classes/sanity.bbclass |    6 ++++++
 meta/lib/oe/terminal.py     |   27 +++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/2 lib/oe/terminal.py: declare konsole from KDE 4.x as unsupported

Konsole 2.x (from KDE 4.x) does not work as devshell - it does not pass the environment or current working directory through among other issues, so do a version check and disable it if it is found (skipping to the next available terminal application.)

---
 meta/lib/oe/terminal.py |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
meta/lib/oe/terminal.py +27 -0
index 3965462..1455e8e 100644
@@ -61,6 +61,15 @@ class Konsole(XTerminal):
     command = 'konsole -T "{title}" -e {command}'
     priority = 2
 
+    def __init__(self, command, title=None, env=None):
+        # Check version
+        vernum = check_konsole_version("konsole")
+        if vernum:
+            if vernum.split('.')[0] == "2":
+                logger.debug(1, 'Konsole from KDE 4.x will not work as devshell, skipping')
+                raise UnsupportedTerminal(self.name)
+        XTerminal.__init__(self, command, title, env)
+
 class XTerm(XTerminal):
     command = 'xterm -T "{title}" -e {command}'
     priority = 1
@@ -104,3 +113,21 @@ def spawn(name, command, title=None, env=None):
     output = pipe.communicate()[0]
     if pipe.returncode != 0:
         raise ExecutionError(pipe.command, pipe.returncode, output)
+
+def check_konsole_version(konsole):
+    import subprocess as sub
+    try:
+        p = sub.Popen(['sh', '-c', '%s --version' % konsole],stdout=sub.PIPE,stderr=sub.PIPE)
+        out, err = p.communicate()
+        ver_info = out.rstrip().split('\n')
+    except OSError as exc:
+        import errno
+        if exc.errno == errno.ENOENT:
+            return None
+        else:
+            raise
+    vernum = None
+    for ver in ver_info:
+        if ver.startswith('Konsole'):
+            vernum = ver.split(' ')[-1]
+    return vernum
Signature · 1 line
1.7.4.1
#2 lore raw

Re: [PATCH 1/2] lib/oe/terminal.py: declare konsole from KDE 4.x as unsupported

Quoted 4 lines · Paul Eggleton

Konsole 2.x (from KDE 4.x) does not work as devshell - it does not pass the environment or current working directory through among other issues, so do a version check and disable it if it is found (skipping to the next available terminal application.)

Thanks for fixing this!

Quoted 2 lines
Quoted 46 lines
---
 meta/lib/oe/terminal.py |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
meta/lib/oe/terminal.py +27 -0
index 3965462..1455e8e 100644
@@ -61,6 +61,15 @@ class Konsole(XTerminal):
     command = 'konsole -T "{title}" -e {command}'
     priority = 2
 
+    def __init__(self, command, title=None, env=None):
+        # Check version
+        vernum = check_konsole_version("konsole")
+        if vernum:
+            if vernum.split('.')[0] == "2":
+                logger.debug(1, 'Konsole from KDE 4.x will not work as devshell, skipping')
+                raise UnsupportedTerminal(self.name)
+        XTerminal.__init__(self, command, title, env)
+
 class XTerm(XTerminal):
     command = 'xterm -T "{title}" -e {command}'
     priority = 1
@@ -104,3 +113,21 @@ def spawn(name, command, title=None, env=None):
     output = pipe.communicate()[0]
     if pipe.returncode != 0:
         raise ExecutionError(pipe.command, pipe.returncode, output)
+
+def check_konsole_version(konsole):
+    import subprocess as sub
+    try:
+        p = sub.Popen(['sh', '-c', '%s --version' % konsole],stdout=sub.PIPE,stderr=sub.PIPE)
+        out, err = p.communicate()
+        ver_info = out.rstrip().split('\n')
+    except OSError as exc:
+        import errno
+        if exc.errno == errno.ENOENT:
+            return None
+        else:
+            raise
+    vernum = None
+    for ver in ver_info:
+        if ver.startswith('Konsole'):
+            vernum = ver.split(' ')[-1]
+    return vernum
Signature · 3 lines
Joshua Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#3 lore raw

PATCH 2/2 sanity.bbclass: add a sanity check for KDE 4.x konsole in TERMCMD

In reply to Paul Eggleton

If the user has specified konsole in TERMCMD and it is version 2.x from KDE 4.x, raise an error as this version will not work for patch resolution purposes (it forks into the background and returns immediately).

Addresses [YOCTO #1294]

---
 meta/classes/sanity.bbclass |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
meta/classes/sanity.bbclass +6 -0
index 93008cc..faacd70 100644
@@ -333,6 +333,12 @@ def check_sanity(e):
         term = termcmd.split()[0]
         if not check_app_exists(term, e.data):
             messages = messages + "The console for use in patch error resolution is not available, please install %s or set TERMCMD and TERMCMDRUN (as documented in local.conf).\n" % term
+        elif "konsole" in term:
+            import oe.terminal
+            vernum = oe.terminal.check_konsole_version(term)
+            if vernum:
+                if vernum.split('.')[0] == '2':
+                    messages = messages +  'Konsole from KDE 4.x will not work as TERMCMD/TERMCMDRUN, please specify a different terminal or set PATCHRESOLVE = "noop" to disable interactive patch resolution.\n'
 
     if os.path.basename(os.readlink('/bin/sh')) == 'dash':
         messages = messages + "Using dash as /bin/sh causes various subtle build problems, please use bash instead (e.g. 'dpkg-reconfigure dash' on an Ubuntu system.\n"
Signature · 1 line
1.7.4.1
#4 lore raw

Re: [PATCH 2/2] sanity.bbclass: add a sanity check for KDE 4.x konsole in TERMCMD

Quoted 8 lines · Paul Eggleton

If the user has specified konsole in TERMCMD and it is version 2.x from KDE 4.x, raise an error as this version will not work for patch resolution purposes (it forks into the background and returns immediately).

Addresses [YOCTO #1294]

Quoted 21 lines
---
 meta/classes/sanity.bbclass |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
meta/classes/sanity.bbclass +6 -0
index 93008cc..faacd70 100644
@@ -333,6 +333,12 @@ def check_sanity(e):
         term = termcmd.split()[0]
         if not check_app_exists(term, e.data):
             messages = messages + "The console for use in patch error resolution is not available, please install %s or set TERMCMD and TERMCMDRUN (as documented in local.conf).\n" % term
+        elif "konsole" in term:
+            import oe.terminal
+            vernum = oe.terminal.check_konsole_version(term)
+            if vernum:
+                if vernum.split('.')[0] == '2':
+                    messages = messages +  'Konsole from KDE 4.x will not work as TERMCMD/TERMCMDRUN, please specify a different terminal or set PATCHRESOLVE = "noop" to disable interactive patch resolution.\n'
 
     if os.path.basename(os.readlink('/bin/sh')) == 'dash':
         messages = messages + "Using dash as /bin/sh causes various subtle build problems, please use bash instead (e.g. 'dpkg-reconfigure dash' on an Ubuntu system.\n"
Signature · 3 lines
Joshua Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
Applied
#5 lore raw
In reply to Paul Eggleton
Quoted 8 lines · Paul Eggleton

The following changes since commit 20529035a4c0befb3c6bdbcb289a2de930fb143d:

bugzilla.bbclass: add a class to report build problems to bugzilla (2011-09-16 17:36:27 +0100)

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/konsole
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/konsole

Quoted 8 lines

Paul Eggleton (2):
lib/oe/terminal.py: declare konsole from KDE 4.x as unsupported sanity.bbclass: add a sanity check for KDE 4.x konsole in TERMCMD

  meta/classes/sanity.bbclass |    6 ++++++
  meta/lib/oe/terminal.py     |   27 +++++++++++++++++++++++++++
  2 files changed, 33 insertions(+), 0 deletions(-)

Merged to OE-Core

Thanks
Sau!