Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] Konsole handling
@ 2011-09-16 17:08 Paul Eggleton
  2011-09-16 17:08 ` [PATCH 1/2] lib/oe/terminal.py: declare konsole from KDE 4.x as unsupported Paul Eggleton
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Paul Eggleton @ 2011-09-16 17:08 UTC (permalink / raw)
  To: openembedded-core

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(-)

-- 
1.7.4.1




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] lib/oe/terminal.py: declare konsole from KDE 4.x as unsupported
  2011-09-16 17:08 [PATCH 0/2] Konsole handling Paul Eggleton
@ 2011-09-16 17:08 ` Paul Eggleton
  2011-09-16 17:29   ` Joshua Lock
  2011-09-16 17:08 ` [PATCH 2/2] sanity.bbclass: add a sanity check for KDE 4.x konsole in TERMCMD Paul Eggleton
  2011-09-19 16:21 ` [PATCH 0/2] Konsole handling Saul Wold
  2 siblings, 1 reply; 6+ messages in thread
From: Paul Eggleton @ 2011-09-16 17:08 UTC (permalink / raw)
  To: openembedded-core

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.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oe/terminal.py |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 3965462..1455e8e 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -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
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] sanity.bbclass: add a sanity check for KDE 4.x konsole in TERMCMD
  2011-09-16 17:08 [PATCH 0/2] Konsole handling Paul Eggleton
  2011-09-16 17:08 ` [PATCH 1/2] lib/oe/terminal.py: declare konsole from KDE 4.x as unsupported Paul Eggleton
@ 2011-09-16 17:08 ` Paul Eggleton
  2011-09-16 17:28   ` Joshua Lock
  2011-09-19 16:21 ` [PATCH 0/2] Konsole handling Saul Wold
  2 siblings, 1 reply; 6+ messages in thread
From: Paul Eggleton @ 2011-09-16 17:08 UTC (permalink / raw)
  To: openembedded-core

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]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/sanity.bbclass |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 93008cc..faacd70 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -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"
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] sanity.bbclass: add a sanity check for KDE 4.x konsole in TERMCMD
  2011-09-16 17:08 ` [PATCH 2/2] sanity.bbclass: add a sanity check for KDE 4.x konsole in TERMCMD Paul Eggleton
@ 2011-09-16 17:28   ` Joshua Lock
  0 siblings, 0 replies; 6+ messages in thread
From: Joshua Lock @ 2011-09-16 17:28 UTC (permalink / raw)
  To: openembedded-core

On Fri, 2011-09-16 at 18:08 +0100, Paul Eggleton wrote:
> 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]
> 
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>

Signed-off-by: Joshua Lock <josh@linux.intel.com>

> ---
>  meta/classes/sanity.bbclass |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 93008cc..faacd70 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -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"

-- 
Joshua Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] lib/oe/terminal.py: declare konsole from KDE 4.x as unsupported
  2011-09-16 17:08 ` [PATCH 1/2] lib/oe/terminal.py: declare konsole from KDE 4.x as unsupported Paul Eggleton
@ 2011-09-16 17:29   ` Joshua Lock
  0 siblings, 0 replies; 6+ messages in thread
From: Joshua Lock @ 2011-09-16 17:29 UTC (permalink / raw)
  To: openembedded-core

On Fri, 2011-09-16 at 18:08 +0100, Paul Eggleton wrote:
> 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!

> 
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>

Signed-off-by: Joshua Lock <josh@linux.intel.com>

> ---
>  meta/lib/oe/terminal.py |   27 +++++++++++++++++++++++++++
>  1 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
> index 3965462..1455e8e 100644
> --- a/meta/lib/oe/terminal.py
> +++ b/meta/lib/oe/terminal.py
> @@ -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

-- 
Joshua Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] Konsole handling
  2011-09-16 17:08 [PATCH 0/2] Konsole handling Paul Eggleton
  2011-09-16 17:08 ` [PATCH 1/2] lib/oe/terminal.py: declare konsole from KDE 4.x as unsupported Paul Eggleton
  2011-09-16 17:08 ` [PATCH 2/2] sanity.bbclass: add a sanity check for KDE 4.x konsole in TERMCMD Paul Eggleton
@ 2011-09-19 16:21 ` Saul Wold
  2 siblings, 0 replies; 6+ messages in thread
From: Saul Wold @ 2011-09-19 16:21 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Paul Eggleton

On 09/16/2011 10:08 AM, Paul Eggleton wrote:
> 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(-)
>
Merged to OE-Core

Thanks
	Sau!



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-09-19 16:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-16 17:08 [PATCH 0/2] Konsole handling Paul Eggleton
2011-09-16 17:08 ` [PATCH 1/2] lib/oe/terminal.py: declare konsole from KDE 4.x as unsupported Paul Eggleton
2011-09-16 17:29   ` Joshua Lock
2011-09-16 17:08 ` [PATCH 2/2] sanity.bbclass: add a sanity check for KDE 4.x konsole in TERMCMD Paul Eggleton
2011-09-16 17:28   ` Joshua Lock
2011-09-19 16:21 ` [PATCH 0/2] Konsole handling Saul Wold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox