All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <rpurdie@rpsys.net>
To: Martin Jansa <martin.jansa@gmail.com>
Cc: openembedded-devel@openembedded.org, bitbake-dev@lists.berlios.de
Subject: Re: [Bitbake-dev] [PATCH] Allow % as wildcard in the end of	PREFERRED_VERSION_pkg
Date: Thu, 21 Jan 2010 10:34:13 +0000	[thread overview]
Message-ID: <1264070053.11679.12.camel@dax.rpnet.com> (raw)
In-Reply-To: <1252881838-19764-1-git-send-email-Martin.Jansa@gmail.com>

On Mon, 2009-09-14 at 00:43 +0200, Martin Jansa wrote:
> ---
>  lib/bb/providers.py |   13 ++++++++++++-
>  1 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/bb/providers.py b/lib/bb/providers.py
> index 8970fb3..feaee52 100644
> --- a/lib/bb/providers.py
> +++ b/lib/bb/providers.py
> @@ -63,7 +63,18 @@ def sortPriorities(pn, dataCache, pkg_pn = None):
>  
>      return tmp_pn
>  
> +def isPreferredVersion(pe, pv, pr, preferred_e, preferred_v, preferred_r):
> +    """
> +    Check if the version pe,pv,pr is the preferred one.
> +    If there is preferred version defined and ends with '%', then pv has to start with that version after removing the '%' in the end,
> +    """
>  
> +    if (pv == preferred_v or (preferred_v != None and preferred_v.endswith('%') and pv.startswith(preferred_v[:len(preferred_v)-1]))):
> +        if (pr == preferred_r or preferred_r == None):
> +            if (pe == preferred_e or preferred_e == None):
> +                return true
> +    return false
> +    
>  def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
>      """
>      Find the first provider in pkg_pn with a PREFERRED_VERSION set.
> @@ -96,7 +107,7 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
>          for file_set in pkg_pn:
>              for f in file_set:
>                  pe,pv,pr = dataCache.pkg_pepvpr[f]
> -                if preferred_v == pv and (preferred_r == pr or preferred_r == None) and (preferred_e == pe or preferred_e == None):
> +                if isPreferredVersion(pe,pv,pr,preferred_e,preferred_v,preferred_r):
>                      preferred_file = f
>                      preferred_ver = (pe, pv, pr)
>                      break

This has been applied to bitbake master, thanks!

Richard




      parent reply	other threads:[~2010-01-21 10:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-13 22:43 [PATCH] Allow % as wildcard in the end of PREFERRED_VERSION_pkg Martin Jansa
2009-09-13 23:08 ` Martin Jansa
2009-09-14 16:39   ` Otavio Salvador
2009-09-14 21:31     ` Martin Jansa
2009-09-15  8:11 ` Phil Blundell
2009-09-15  9:16   ` Martin Jansa
2009-09-15 10:31     ` Phil Blundell
2009-09-15 11:56       ` Martin Jansa
2009-09-15 13:38         ` Phil Blundell
2009-09-15 13:23   ` Richard Purdie
2010-01-21 10:34 ` Richard Purdie [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=1264070053.11679.12.camel@dax.rpnet.com \
    --to=rpurdie@rpsys.net \
    --cc=bitbake-dev@lists.berlios.de \
    --cc=martin.jansa@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=openembedded-devel@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.