[poky] [PATCH 1/2] distro_alias.inc: Sort entries

Peter Kjellerstedt peter.kjellerstedt at axis.com
Wed Oct 2 00:30:44 PDT 2013


> -----Original Message-----
> From: poky-bounces at yoctoproject.org [mailto:poky-
> bounces at yoctoproject.org] On Behalf Of Elizabeth Flanagan
> Sent: den 1 oktober 2013 21:31
> To: poky at yoctoproject.org
> Subject: [poky] [PATCH 1/2] distro_alias.inc: Sort entries
> 
> Entry order is inconsistent. sort -d on entries.
> 
> Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan at intel.com>
> ---
>  meta-yocto/conf/distro/include/distro_alias.inc |   28 +++++++++++----
> --------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/meta-yocto/conf/distro/include/distro_alias.inc b/meta-yocto/conf/distro/include/distro_alias.inc
> index bd3362a..fd1e47d 100644
> --- a/meta-yocto/conf/distro/include/distro_alias.inc
> +++ b/meta-yocto/conf/distro/include/distro_alias.inc

[cut]

> @@ -75,8 +75,8 @@ DISTRO_PN_ALIAS_pn-damageproto = "Meego=xorg-x11-proto-damageproto"
>  DISTRO_PN_ALIAS_pn-db = "Debian=db5.1 Ubuntu=db5.1"
>  DISTRO_PN_ALIAS_pn-dbus-wait = "OpenedHand"
>  DISTRO_PN_ALIAS_pn-directfb-examples = "Debian=directfb Fedora=directfb"
> -DISTRO_PN_ALIAS_pn-distcc = "Debian=distcc Fedora=distcc"
>  DISTRO_PN_ALIAS_pn-distcc-config = "OpenedHand"
> +DISTRO_PN_ALIAS_pn-distcc = "Debian=distcc Fedora=distcc"
>  DISTRO_PN_ALIAS_pn-dmxproto = "Meego=xorg-x11-proto-dmxproto Ubuntu=x11proto-dmx Debian=x11proto-dmx"
>  DISTRO_PN_ALIAS_pn-docbook-dsssl-stylesheets = "Fedora=docbook-style-dsssl Ubuntu=docbook-dsssl"
>  DISTRO_PN_ALIAS_pn-docbook-sgml-dtd-3.1 = "Fedora=docbook-dtds Mandriva=docbook-dtd31-sgml"

Using sort -d on the data as it is results in somewhat weird 
results since it is not just sorted on the variable name, but 
also on the space following it. May I suggest using something 
like the following instead to do the sorting:

sed -re 's/^([^[:space:]]+)[[:space:]]*=[[:space:]]*"/\1 = "/g' -e 's/[[:space:]]=/1111=/g' distro_alias.inc | sort -d | sed -e 's/1111=/ =/g' > distro_alias.inc.new

In addition to sorting shorter variables before longer it will 
also correct inconsistencies in spacing around the equal sign.

//Peter




More information about the poky mailing list