* [PATCH v2] depexp.py: Fix segfault if DISPLAY is not set
@ 2015-02-09 13:41 Maxin B. John
2015-02-12 11:53 ` Maxin B. John
2015-02-13 17:02 ` Richard Purdie
0 siblings, 2 replies; 4+ messages in thread
From: Maxin B. John @ 2015-02-09 13:41 UTC (permalink / raw)
To: bitbake-devel
bitbake -g -u depexp <package> segfaults when DISPLAY is not set
properly. Fix it with a proper check.
[YOCTO #7299]
Signed-off-by: Maxin B. John <maxin.john@enea.com>
---
bitbake/lib/bb/ui/depexp.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py
index 0c71a3e..1b8f0b2 100644
--- a/bitbake/lib/bb/ui/depexp.py
+++ b/bitbake/lib/bb/ui/depexp.py
@@ -17,6 +17,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+import sys
import gobject
import gtk
import Queue
@@ -215,6 +216,12 @@ def main(server, eventHandler, params):
print("XMLRPC Fault getting commandline:\n %s" % x)
return
+ try:
+ gtk.init_check()
+ except:
+ sys.stderr.write("Please set DISPLAY variable before running this command \n")
+ return
+
shutdown = 0
gtkgui = gtkthread(shutdown)
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] depexp.py: Fix segfault if DISPLAY is not set
2015-02-09 13:41 [PATCH v2] depexp.py: Fix segfault if DISPLAY is not set Maxin B. John
@ 2015-02-12 11:53 ` Maxin B. John
2015-02-13 17:02 ` Richard Purdie
1 sibling, 0 replies; 4+ messages in thread
From: Maxin B. John @ 2015-02-12 11:53 UTC (permalink / raw)
To: bitbake-devel
gentle ping..
On Mon, Feb 09, 2015 at 02:41:17PM +0100, Maxin B. John wrote:
> bitbake -g -u depexp <package> segfaults when DISPLAY is not set
> properly. Fix it with a proper check.
>
> [YOCTO #7299]
>
> Signed-off-by: Maxin B. John <maxin.john@enea.com>
> ---
> bitbake/lib/bb/ui/depexp.py | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py
> index 0c71a3e..1b8f0b2 100644
> --- a/bitbake/lib/bb/ui/depexp.py
> +++ b/bitbake/lib/bb/ui/depexp.py
> @@ -17,6 +17,7 @@
> # with this program; if not, write to the Free Software Foundation, Inc.,
> # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
>
> +import sys
> import gobject
> import gtk
> import Queue
> @@ -215,6 +216,12 @@ def main(server, eventHandler, params):
> print("XMLRPC Fault getting commandline:\n %s" % x)
> return
>
> + try:
> + gtk.init_check()
> + except:
> + sys.stderr.write("Please set DISPLAY variable before running this command \n")
> + return
> +
> shutdown = 0
>
> gtkgui = gtkthread(shutdown)
> --
> 1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] depexp.py: Fix segfault if DISPLAY is not set
2015-02-09 13:41 [PATCH v2] depexp.py: Fix segfault if DISPLAY is not set Maxin B. John
2015-02-12 11:53 ` Maxin B. John
@ 2015-02-13 17:02 ` Richard Purdie
2015-02-16 8:24 ` Maxin B. John
1 sibling, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2015-02-13 17:02 UTC (permalink / raw)
To: Maxin B. John; +Cc: bitbake-devel
On Mon, 2015-02-09 at 14:41 +0100, Maxin B. John wrote:
> bitbake -g -u depexp <package> segfaults when DISPLAY is not set
> properly. Fix it with a proper check.
>
> [YOCTO #7299]
>
> Signed-off-by: Maxin B. John <maxin.john@enea.com>
> ---
> bitbake/lib/bb/ui/depexp.py | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py
> index 0c71a3e..1b8f0b2 100644
> --- a/bitbake/lib/bb/ui/depexp.py
> +++ b/bitbake/lib/bb/ui/depexp.py
> @@ -17,6 +17,7 @@
> # with this program; if not, write to the Free Software Foundation, Inc.,
> # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
>
> +import sys
> import gobject
> import gtk
> import Queue
> @@ -215,6 +216,12 @@ def main(server, eventHandler, params):
> print("XMLRPC Fault getting commandline:\n %s" % x)
> return
>
> + try:
> + gtk.init_check()
> + except:
> + sys.stderr.write("Please set DISPLAY variable before running this command \n")
> + return
Sorry about the delay in replying. Its usually bad form to put generic
except clauses into python. Is there a specific exception we should be
trapping here?
Cheers,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] depexp.py: Fix segfault if DISPLAY is not set
2015-02-13 17:02 ` Richard Purdie
@ 2015-02-16 8:24 ` Maxin B. John
0 siblings, 0 replies; 4+ messages in thread
From: Maxin B. John @ 2015-02-16 8:24 UTC (permalink / raw)
To: Richard Purdie; +Cc: bitbake-devel
Hi,
On Fri, Feb 13, 2015 at 05:02:45PM +0000, Richard Purdie wrote:
> On Mon, 2015-02-09 at 14:41 +0100, Maxin B. John wrote:
> > bitbake -g -u depexp <package> segfaults when DISPLAY is not set
> > properly. Fix it with a proper check.
> >
> > [YOCTO #7299]
> >
> > Signed-off-by: Maxin B. John <maxin.john@enea.com>
> > ---
> > bitbake/lib/bb/ui/depexp.py | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py
> > index 0c71a3e..1b8f0b2 100644
> > --- a/bitbake/lib/bb/ui/depexp.py
> > +++ b/bitbake/lib/bb/ui/depexp.py
> > @@ -17,6 +17,7 @@
> > # with this program; if not, write to the Free Software Foundation, Inc.,
> > # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> >
> > +import sys
> > import gobject
> > import gtk
> > import Queue
> > @@ -215,6 +216,12 @@ def main(server, eventHandler, params):
> > print("XMLRPC Fault getting commandline:\n %s" % x)
> > return
> >
> > + try:
> > + gtk.init_check()
> > + except:
> > + sys.stderr.write("Please set DISPLAY variable before running this command \n")
> > + return
>
> Sorry about the delay in replying. Its usually bad form to put generic
> except clauses into python. Is there a specific exception we should be
> trapping here?
The exception should be the RuntimeError here. I will update and send
the v3.
> Cheers,
> Richard
Best Regards,
Maxin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-16 8:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-09 13:41 [PATCH v2] depexp.py: Fix segfault if DISPLAY is not set Maxin B. John
2015-02-12 11:53 ` Maxin B. John
2015-02-13 17:02 ` Richard Purdie
2015-02-16 8:24 ` Maxin B. John
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.