Tidy up patches
cover Tidy up patches
From: Joshua Lock <[email protected]>
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 <[email protected]>
---
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
Signature · 1 line
1.7.4
PATCH 1/2 bitbake/bitbake-layers: fix to run with recent changes
From: Joshua Lock <[email protected]>
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.
--- bitbake/bin/bitbake-layers | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) mode change 100644 => 100755 bitbake/bin/bitbake-layers
bitbake/bin/bitbake-layers +8 -4
@@ -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)
Signature · 1 line
1.7.4
PATCH 2/2 bitbake/xmlrpc: only use BBTransport for affected Python versions
In reply to Joshua LockFrom: Joshua Lock <[email protected]>
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.
--- bitbake/lib/bb/server/xmlrpc.py | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-)
bitbake/lib/bb/server/xmlrpc.py +17 -4
@@ -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)
Signature · 1 line
1.7.4
Richard Purdie
AppliedQuoted 17 lines · Joshua Lock
From: Joshua Lock <[email protected]>
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/masterThanks,
Joshua Lock <[email protected]>
---
Quoted 8 lines
Joshua Lock (2):
bitbake/bitbake-layers: fix to run with recent changes bitbake/xmlrpc: only use BBTransport for affected Python versionsbitbake/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