[bitbake-devel] [PATCH V2 2/2] bitbake-layers: add a ability to query layer dependencies from layer index

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Thu Jan 22 21:09:13 UTC 2015


On January 22, 2015 6:05:36 PM GMT+01:00, Bernhard Reutner-Fischer <rep.dot.nop at gmail.com> wrote:
>> (host, port) = parsedurl.netloc.split(":")
>
>Please rsplit, don't add more of these bugs..
>http://lists.openembedded.org/pipermail/bitbake-devel/2013-June/003533.html

Something like

def splitport(host):
   """splitport('host:port') --> 'host', 'port'.""" 
   if host[0] == '[':
     # Escaped IPv6 
     host, port = host[1:].split(']', 1)
     if ':' in port:
       port = port.rsplit(':', 1)[1]
     else:
       port = None
   else:
      if host.count(':') == 1:
        # IPv4
        host, port = host.split(':')
      else:
        # unescaped IPv6 hosts with port are a no go
        port = None
   return (host, None if port is None else int(port)) 

And fixup all callers.
I don't have a real keyboard at hand ATM..

Thanks,




More information about the bitbake-devel mailing list