All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PRService/meta V2 2/3] package.bbclass: per recipe PRSERV_HOST support
Date: Fri, 06 Jan 2012 13:07:49 +0000	[thread overview]
Message-ID: <1325855269.20759.100.camel@ted> (raw)
In-Reply-To: <93c736cc566ed205d532bea9390d64bec86f8dae.1325302234.git.lianhao.lu@intel.com>

On Sat, 2011-12-31 at 11:31 +0800, Lianhao Lu wrote:
> [YOCTO #1126]
> Added per recipe PRSERV_HOST PRSERV_PORT support.
> 
> Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
> ---
>  meta/classes/package.bbclass |    8 ++++++++
>  meta/conf/bitbake.conf       |    2 +-
>  2 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> index 65e6571..f8f0a12 100644
> --- a/meta/classes/package.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -350,6 +350,14 @@ def runtime_mapping_rename (varname, d):
>  #
>  
>  python package_get_auto_pr() {
> +	# per recipe PRSERV_HOST PRSERV_PORT
> +	pn = d.getVar('PN', True)
> +	host = d.getVar("PRSERV_HOST_" + pn, True)
> +	port = d.getVar("PRSERV_PORT_" + pn, True)
> +	if not (host is None):
> +		d.setVar("PRSERV_HOST", host)
> +	if not (port is None):
> +		d.setVar("PRSERV_PORT", port)
>  	if d.getVar('USE_PR_SERV', True) != "0":
>  		try:
>  			auto_pr=prserv_get_pr_auto(d)
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 31a722e..6b1744f 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -190,7 +190,7 @@ BP = "${BPN}-${PV}"
>  #
>  # network based PR service
>  #
> -USE_PR_SERV = "${@[1,0][((d.getVar('PRSERV_HOST',1) is None) or (d.getVar('PRSERV_PORT',1) is None)) and (d.getVar('PRSERV_LOCKDOWN',1) is None)]}"
> +USE_PR_SERV = "${@[1,0][((d.getVar('PRSERV_HOST',1) is None) or (d.getVar('PRSERV_HOST',1) == "") or (d.getVar('PRSERV_PORT',1) is None) or (d.getVar('PRSERV_PORT',1) == "")) and (d.getVar('PRSERV_LOCKDOWN',1) is None)]}"

Instead of:

(d.getVar('PRSERV_HOST',1) is None) or (d.getVar('PRSERV_HOST',1) == "")

you should just be able to say

(not d.getVar('PRSERV_HOST', True))

since both None and "" evaluate to False.

Please also use True instead of 1 and False instead of 0. I appreciate
there are bad examples around but we're trying to clean them up.

Cheers,

Richard





  reply	other threads:[~2012-01-06 13:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-31  3:31 [PRService/meta V2 0/3] new PRService features in meta Lianhao Lu
2011-12-31  3:31 ` [PRService/meta V2 1/3] meta/PRService: Added export/import fuctions Lianhao Lu
2012-01-06 13:28   ` Richard Purdie
2012-01-06 13:34   ` Richard Purdie
2012-01-06 14:29     ` Richard Purdie
2011-12-31  3:31 ` [PRService/meta V2 2/3] package.bbclass: per recipe PRSERV_HOST support Lianhao Lu
2012-01-06 13:07   ` Richard Purdie [this message]
2011-12-31  3:31 ` [PRService/meta V2 3/3] conf/bitbake.conf: basichash as default signature Lianhao Lu

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=1325855269.20759.100.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /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.