Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] package_deb.bbclass: don't handle advanced dependency marker as version number
Date: Wed, 09 May 2012 21:00:55 -0700	[thread overview]
Message-ID: <4FAB3D77.7050905@linux.intel.com> (raw)
In-Reply-To: <1336614104-1825-1-git-send-email-cazfi74@gmail.com>

On 05/09/2012 06:41 PM, Marko Lindqvist wrote:
> Strip advanced dependency markers away from Provides before writing
> them to control file. Left in place they would mean package version
> number in control file format.
>
> Signed-off-by: Marko Lindqvist<cazfi74@gmail.com>
> ---
>   meta/classes/package_deb.bbclass |   19 ++++++++++++++++++-
>   1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
> index dc0f963..c51bf3c 100644
> --- a/meta/classes/package_deb.bbclass
> +++ b/meta/classes/package_deb.bbclass
> @@ -206,6 +206,23 @@ python do_package_deb () {
>       import re, copy
>       import textwrap
>
> +    def deb_explode_dep_ver(varname):
> +        # Remove markers from string so they won't get handled as version numbers
> +        depstr = localdata.getVar(varname, True) or ""
> +        start = depstr.find("(")
> +        while start != -1:
> +            # We are not searching ")" from full string in case it's malformed in a way
> +            # that first ")" is before first "("
> +            endstr = depstr[start:len(depstr)]
> +            end = endstr.find(")")
> +            if (end == len(endstr) - 1) or (end == -1):
> +                tmpstr = depstr[0:start]
> +            else:
> +                tmpstr = depstr[0:start] + depstr[start+end+1:len(depstr)]
> +            depstr = tmpstr
> +            start = depstr.find("(")
> +        return bb.utils.explode_dep_versions(depstr)
> +
>       workdir = d.getVar('WORKDIR', True)
>       if not workdir:
>           bb.error("WORKDIR not defined, unable to package")
> @@ -341,7 +358,7 @@ python do_package_deb () {
>                   if '*' in dep:
>                           del rrecommends[dep]
>           rsuggests = bb.utils.explode_dep_versions(localdata.getVar("RSUGGESTS", True) or "")
> -        rprovides = bb.utils.explode_dep_versions(localdata.getVar("RPROVIDES", True) or "")
> +        rprovides = deb_explode_dep_ver("RPROVIDES")
>           rreplaces = bb.utils.explode_dep_versions(localdata.getVar("RREPLACES", True) or "")
>           rconflicts = bb.utils.explode_dep_versions(localdata.getVar("RCONFLICTS", True) or "")
>           if rdepends:

Marko, Just to let you know that worked much better!

Thanks

Sau!



      reply	other threads:[~2012-05-10  4:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10  1:41 [PATCH] package_deb.bbclass: don't handle advanced dependency marker as version number Marko Lindqvist
2012-05-10  4:00 ` Saul Wold [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=4FAB3D77.7050905@linux.intel.com \
    --to=sgw@linux.intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox