[oe] Escaping in PACKAGECONFIG

Paul Eggleton paul.eggleton at linux.intel.com
Wed Jan 14 12:18:23 UTC 2015


Hi Zoltán,

On Wednesday 26 November 2014 19:17:16 Boszormenyi Zoltan wrote:
> what is the proper way of escaping a comma in the string specified for
> PACKAGECONFIG? I would like to use something like the below in my custom
> PHP recipe:
> 
> PACKAGECONFIG[mysql] = ' \
>                         --enable-mysqlnd="shared" \
>                         --with-mysql="shared,mysqlnd" \
>                         --with-mysqli="shared,mysqlnd" \
>                        
> --with-mysql-sock=${localstatedir}/lib/mysql/mysql.sock \
> --with-pdo-mysql="shared,mysqlnd" \
>                         , \
>                         ,mysql5'
> 
> With ...="shared,mysqlnd", ...="shared\,mysqlnd" or ...="shared\\,mysqlnd" I
> get:
> 
> ERROR: Only enable,disable,depend,rdepend can be specified!
> 
> and
> 
> ERROR: Nothing PROVIDES 'mysqlnd"' (but .../php/php_5.6.3.bb DEPENDS on or
> otherwise requires it). Close matches:
>   mysql5
> ERROR: Required build target 'php' has no buildable providers.
> Missing or unbuildable dependency chain was: ['php', 'mysqlnd"']
> 
> But, this works:
> 
> MYSQLND="shared,mysqlnd"
> PACKAGECONFIG[mysql] = ' \
>                         --enable-mysqlnd="shared" \
>                         --with-mysql=${MYSQLND} \
>                         --with-mysqli=${MYSQLND} \
>                        
> --with-mysql-sock=${localstatedir}/lib/mysql/mysql.sock \
> --with-pdo-mysql=${MYSQLND} \
>                         , \
>                         ,mysql5'
> 
> Why?

Sorry for the delayed response. Basically, if you look at how PACKAGECONFIG is 
implemented in meta/classes/base.bbclass, we simply do a python split() call 
on the value of each varflag value (i.e. each individual PACKAGECONFIG[xyz] 
value). However, because we get that value using getVarFlags() without passing 
True for the "expand" parameter, the value is unexpanded, so variable 
references such as ${MYSQLND} above won't have been expanded when the string 
gets split. I'm not sure if that was intentional but it is how it has been 
implemented; I don't think anyone has given much thought to cases like this 
where you need to have commas in the value since it's relatively uncommon.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the Openembedded-devel mailing list