All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Tidy up patches
@ 2011-03-14 14:35 Joshua Lock
  2011-03-14 14:35 ` [PATCH 1/2] bitbake/bitbake-layers: fix to run with recent changes Joshua Lock
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Joshua Lock @ 2011-03-14 14:35 UTC (permalink / raw)
  To: poky

From: Joshua Lock <josh@linux.intel.com>

This series consists of a couple of tidy up patches for Poky's BitBake.

The first enables bitbake-layers to work whilst the second changes our XML-RPC
server to only use the copy/paste Transport implementation for known broken
versions of Python.

Pull URL: git://git.pokylinux.org/poky-contrib.git
  Branch: josh/master
  Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=josh/master

Thanks,
    Joshua Lock <josh@linux.intel.com>
---


Joshua Lock (2):
  bitbake/bitbake-layers: fix to run with recent changes
  bitbake/xmlrpc: only use BBTransport for affected Python versions

 bitbake/bin/bitbake-layers      |   12 ++++++++----
 bitbake/lib/bb/server/xmlrpc.py |   21 +++++++++++++++++----
 2 files changed, 25 insertions(+), 8 deletions(-)
 mode change 100644 => 100755 bitbake/bin/bitbake-layers

-- 
1.7.4



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

* [PATCH 1/2] bitbake/bitbake-layers: fix to run with recent changes
  2011-03-14 14:35 [PATCH 0/2] Tidy up patches Joshua Lock
@ 2011-03-14 14:35 ` Joshua Lock
  2011-03-14 14:35 ` [PATCH 2/2] bitbake/xmlrpc: only use BBTransport for affected Python versions Joshua Lock
  2011-03-14 21:10 ` [PATCH 0/2] Tidy up patches Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Joshua Lock @ 2011-03-14 14:35 UTC (permalink / raw)
  To: poky

From: Joshua Lock <josh@linux.intel.com>

This patch marks the bitbake-layers script as executable and fixes the
instantiation of the BBCooker to match recent changes in the BitBake
libraries.

I've also added a brief header which demonstrates the intent and usage
as taken from Chris Larson's original commit message.

Note: this fix is not upstreamable, it's only required in Poky because of an
outstanding difference between BitBake master and Poky's BitBake.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 bitbake/bin/bitbake-layers |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
 mode change 100644 => 100755 bitbake/bin/bitbake-layers

diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
old mode 100644
new mode 100755
index ea903e5..b6106cd
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -1,5 +1,11 @@
 #!/usr/bin/env python
 
+# This script has subcommands which operate against your bitbake layers, either
+# displaying useful information, or acting against them.
+# Currently, it only provides a show_appends command, which shows you what
+# bbappends are in effect, and warns you if you have appends which are not being
+# utilized.
+
 import cmd
 import logging
 import os.path
@@ -13,6 +19,7 @@ import bb.cache
 import bb.cooker
 import bb.providers
 from bb.cooker import state
+from bb.server import none
 
 
 logger = logging.getLogger('BitBake')
@@ -38,14 +45,11 @@ class Commands(cmd.Cmd):
         self.returncode = 0
         self.config = Config(parse_only=True)
         self.cooker = bb.cooker.BBCooker(self.config,
-                                         self.register_idle_function)
+                                         bb.server.none)
         self.config_data = self.cooker.configuration.data
         bb.providers.logger.setLevel(logging.ERROR)
         self.prepare_cooker()
 
-    def register_idle_function(self, function, data):
-        pass
-
     def prepare_cooker(self):
         sys.stderr.write("Parsing recipes..")
         logger.setLevel(logging.ERROR)
-- 
1.7.4



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

* [PATCH 2/2] bitbake/xmlrpc: only use BBTransport for affected Python versions
  2011-03-14 14:35 [PATCH 0/2] Tidy up patches Joshua Lock
  2011-03-14 14:35 ` [PATCH 1/2] bitbake/bitbake-layers: fix to run with recent changes Joshua Lock
@ 2011-03-14 14:35 ` Joshua Lock
  2011-03-14 21:10 ` [PATCH 0/2] Tidy up patches Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Joshua Lock @ 2011-03-14 14:35 UTC (permalink / raw)
  To: poky

From: Joshua Lock <josh@linux.intel.com>

Upstream have fixed the xmlrpclip.Transport() bug from Python #8194 for
the Python 2.7.2 release, therefore as we know which versions of the
standard library are affected we can only use our copy/paste class when
it's needed.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 bitbake/lib/bb/server/xmlrpc.py |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py
index 0d03e30..e7b6010 100644
--- a/bitbake/lib/bb/server/xmlrpc.py
+++ b/bitbake/lib/bb/server/xmlrpc.py
@@ -52,6 +52,8 @@ if sys.hexversion < 0x020600F0:
 # implementations from Python 2.6.6's xmlrpclib.
 #
 # Upstream Python bug is #8194 (http://bugs.python.org/issue8194)
+# This bug is relevant for Python 2.7.0 and 2.7.1 but was fixed for
+# Python > 2.7.2
 ##
 
 class BBTransport(xmlrpclib.Transport):
@@ -107,6 +109,18 @@ class BBTransport(xmlrpclib.Transport):
 
         return u.close()
 
+def _create_server(host, port):
+    # Python 2.7.0 and 2.7.1 have a buggy Transport implementation
+    # For those versions of Python, and only those versions, use our
+    # own copy/paste BBTransport class.
+    if (2, 7, 0) <= sys.version_info < (2, 7, 2):
+        t = BBTransport()
+        s = xmlrpclib.Server("http://%s:%d/" % (host, port), transport=t, allow_none=True)
+    else:
+        s = xmlrpclib.Server("http://%s:%d/" % (host, port), allow_none=True)
+
+    return s
+
 class BitBakeServerCommands():
     def __init__(self, server, cooker):
         self.cooker = cooker
@@ -116,8 +130,8 @@ class BitBakeServerCommands():
         """
         Register a remote UI Event Handler
         """
-        t = BBTransport()
-        s = xmlrpclib.Server("http://%s:%d/" % (host, port), transport=t, allow_none=True)
+        s = _create_server(host, port)
+
         return bb.event.register_UIHhandler(s)
 
     def unregisterEventHandler(self, handlerNum):
@@ -240,8 +254,7 @@ class BitbakeUILauch():
 
 class BitBakeServerConnection():
     def __init__(self, serverinfo):
-        t = BBTransport()
-        self.connection = xmlrpclib.Server("http://%s:%s" % (serverinfo.host, serverinfo.port), transport=t, allow_none=True)
+        self.connection = _create_server(serverinfo.host, serverinfo.port)
         self.events = uievent.BBUIEventQueue(self.connection)
         for event in bb.event.ui_queue:
             self.events.queue_event(event)
-- 
1.7.4



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

* Re: [PATCH 0/2] Tidy up patches
  2011-03-14 14:35 [PATCH 0/2] Tidy up patches Joshua Lock
  2011-03-14 14:35 ` [PATCH 1/2] bitbake/bitbake-layers: fix to run with recent changes Joshua Lock
  2011-03-14 14:35 ` [PATCH 2/2] bitbake/xmlrpc: only use BBTransport for affected Python versions Joshua Lock
@ 2011-03-14 21:10 ` Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2011-03-14 21:10 UTC (permalink / raw)
  To: Joshua Lock; +Cc: poky

On Mon, 2011-03-14 at 14:35 +0000, Joshua Lock wrote:
> From: Joshua Lock <josh@linux.intel.com>
> 
> This series consists of a couple of tidy up patches for Poky's BitBake.
> 
> The first enables bitbake-layers to work whilst the second changes our XML-RPC
> server to only use the copy/paste Transport implementation for known broken
> versions of Python.
> 
> Pull URL: git://git.pokylinux.org/poky-contrib.git
>   Branch: josh/master
>   Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=josh/master
> 
> Thanks,
>     Joshua Lock <josh@linux.intel.com>
> ---
> 
> 
> Joshua Lock (2):
>   bitbake/bitbake-layers: fix to run with recent changes
>   bitbake/xmlrpc: only use BBTransport for affected Python versions
> 
>  bitbake/bin/bitbake-layers      |   12 ++++++++----
>  bitbake/lib/bb/server/xmlrpc.py |   21 +++++++++++++++++----
>  2 files changed, 25 insertions(+), 8 deletions(-)
>  mode change 100644 => 100755 bitbake/bin/bitbake-layers

Merged into poky master, thanks.

Richard




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

end of thread, other threads:[~2011-03-14 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-14 14:35 [PATCH 0/2] Tidy up patches Joshua Lock
2011-03-14 14:35 ` [PATCH 1/2] bitbake/bitbake-layers: fix to run with recent changes Joshua Lock
2011-03-14 14:35 ` [PATCH 2/2] bitbake/xmlrpc: only use BBTransport for affected Python versions Joshua Lock
2011-03-14 21:10 ` [PATCH 0/2] Tidy up patches Richard Purdie

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.