All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: Chong Lu <Chong.Lu@windriver.com>,
	bitbake-devel@lists.openembedded.org,
	paul.eggleton@linux.intel.com
Subject: Re: [PATCH V2 2/2] bitbake-layers: add a ability to	query layer dependencies from layer index
Date: Thu, 22 Jan 2015 22:09:13 +0100	[thread overview]
Message-ID: <C0BC539D-E32D-478B-8E62-2EE9EEB70C55@gmail.com> (raw)
In-Reply-To: <77A8CA6E-0A1D-4E38-B4C0-98EAA4711824@gmail.com>

On January 22, 2015 6:05:36 PM GMT+01:00, Bernhard Reutner-Fischer <rep.dot.nop@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,



      reply	other threads:[~2015-01-22 21:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22  2:53 [PATCH V2 0/2] bitbake-layers: add a ability to query layer dependencies from layer index Chong Lu
2015-01-22  2:53 ` [PATCH V2 1/2] bitbake.conf: Add two variables for " Chong Lu
2015-01-22  2:53 ` [PATCH V2 2/2] bitbake-layers: add a ability to query layer dependencies from " Chong Lu
2015-01-22 17:05   ` Bernhard Reutner-Fischer
2015-01-22 21:09     ` Bernhard Reutner-Fischer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C0BC539D-E32D-478B-8E62-2EE9EEB70C55@gmail.com \
    --to=rep.dot.nop@gmail.com \
    --cc=Chong.Lu@windriver.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=paul.eggleton@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.