Patchwork [bitbake-devel,3/4] bitbake: fixes in executable

login
register
mail settings
Submitter Alexandru DAMIAN
Date May 31, 2013, 11:06 a.m.
Message ID <1369998409-16560-3-git-send-email-alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/50939/
State Accepted
Commit b657208ee15ae065e5fcc2dd6e0051e03d246727
Headers show

Comments

Alexandru DAMIAN - May 31, 2013, 11:06 a.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

Two fixes in bitbake related to running remote servers -
* can now specify correctly the bind port
* the information in print conforms to common server infrastructure

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 bin/bitbake | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Bernhard Reutner-Fischer - June 5, 2013, 8:51 p.m.
On 31 May 2013 13:06, Alex DAMIAN <alexandru.damian@intel.com> wrote:
> From: Alexandru DAMIAN <alexandru.damian@intel.com>
>
> Two fixes in bitbake related to running remote servers -
> * can now specify correctly the bind port
> * the information in print conforms to common server infrastructure
>
> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
> ---
>  bin/bitbake | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/bin/bitbake b/bin/bitbake
> index f3bbeb4..d263cbd 100755
> --- a/bin/bitbake
> +++ b/bin/bitbake
> @@ -204,7 +204,8 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
>  def start_server(servermodule, configParams, configuration):
>      server = servermodule.BitBakeServer()
>      if configParams.bind:
> -        server.initServer((configParams.bind, 0))
> +        (host, port) = configParams.bind.split(':')

[::]:1025

I.e. Does that work nicely on my v6-only box or did you mean .rsplit(':',2) ?
thanks,
> +        server.initServer((host, int(port)))
>      else:
>          server.initServer()
>
> @@ -313,7 +314,7 @@ def main():
>              bb.event.ui_queue = []
>              server_connection.terminate()
>      else:
> -        print("server address: %s, server port: %s" % (server.serverinfo.host, server.serverinfo.port))
> +        print("server address: %s, server port: %s" % (server.serverImpl.host, server.serverImpl.port))
>
>      return 1
>
Alexandru DAMIAN - June 7, 2013, 2:49 p.m.
Point taken. Unfortunately, this type of code if all over the place in
BB, so a subsequent patch will have to solve it, once we have testing
environment going on for this.

I'll add this to my list, but it is low priority. Patches welcome, though :)

Alex


On Wed, Jun 5, 2013 at 9:51 PM, Bernhard Reutner-Fischer <
rep.dot.nop@gmail.com> wrote:

> On 31 May 2013 13:06, Alex DAMIAN <alexandru.damian@intel.com> wrote:
> > From: Alexandru DAMIAN <alexandru.damian@intel.com>
> >
> > Two fixes in bitbake related to running remote servers -
> > * can now specify correctly the bind port
> > * the information in print conforms to common server infrastructure
> >
> > Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
> > ---
> >  bin/bitbake | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/bin/bitbake b/bin/bitbake
> > index f3bbeb4..d263cbd 100755
> > --- a/bin/bitbake
> > +++ b/bin/bitbake
> > @@ -204,7 +204,8 @@ class
> BitBakeConfigParameters(cookerdata.ConfigParameters):
> >  def start_server(servermodule, configParams, configuration):
> >      server = servermodule.BitBakeServer()
> >      if configParams.bind:
> > -        server.initServer((configParams.bind, 0))
> > +        (host, port) = configParams.bind.split(':')
>
> [::]:1025
>
> I.e. Does that work nicely on my v6-only box or did you mean
> .rsplit(':',2) ?
> thanks,
> > +        server.initServer((host, int(port)))
> >      else:
> >          server.initServer()
> >
> > @@ -313,7 +314,7 @@ def main():
> >              bb.event.ui_queue = []
> >              server_connection.terminate()
> >      else:
> > -        print("server address: %s, server port: %s" %
> (server.serverinfo.host, server.serverinfo.port))
> > +        print("server address: %s, server port: %s" %
> (server.serverImpl.host, server.serverImpl.port))
> >
> >      return 1
> >
>

Patch

diff --git a/bin/bitbake b/bin/bitbake
index f3bbeb4..d263cbd 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -204,7 +204,8 @@  class BitBakeConfigParameters(cookerdata.ConfigParameters):
 def start_server(servermodule, configParams, configuration):
     server = servermodule.BitBakeServer()
     if configParams.bind:
-        server.initServer((configParams.bind, 0))
+        (host, port) = configParams.bind.split(':')
+        server.initServer((host, int(port)))
     else:
         server.initServer()
 
@@ -313,7 +314,7 @@  def main():
             bb.event.ui_queue = []
             server_connection.terminate()
     else:
-        print("server address: %s, server port: %s" % (server.serverinfo.host, server.serverinfo.port))
+        print("server address: %s, server port: %s" % (server.serverImpl.host, server.serverImpl.port))
 
     return 1