[OE-core] would replacing packagegroup names with "${PN}" be useless code churn?

Robert P. J. Day rpjday at crashcourse.ca
Tue Jul 15 12:03:19 UTC 2014


On Tue, 15 Jul 2014, Robert P. J. Day wrote:

>
>   just my sheldon cooper-like OCD coming through again, but i long ago
> noted that some packagegroup files do this:
>
>   RDEPENDS_${PN} = "openssh"
>
> while others spell out (unnecessarily) the packagegroup name:
>
>   RDEPENDS_packagegroup-core-buildessential = "\
>
> when using ${PN} would have worked just fine. i'm a big fan of brevity
> so i can whip up a patch to shorter all those lines and make them
> clearer, unless folks think that's just unnecessary code churn.

  my own followup to this ... there's the occasional packagegroup file
for which this would cause numerous changes; take a look at
packagegroup-base.bb:

PACKAGES = ' \
            packagegroup-base \
            packagegroup-base-extended \
            packagegroup-distro-base \
            packagegroup-machine-base \
            \
            ${@bb.utils.contains("MACHINE_FEATURES", "acpi", "packagegroup-base-acpi", "",d)} \
            ${@bb.utils.contains("MACHINE_FEATURES", "alsa", "packagegroup-base-alsa", "", d)} \
            ${@bb.utils.contains("MACHINE_FEATURES", "apm", "packagegroup-base-apm", "", d)} \
            ${@bb.utils.contains("MACHINE_FEATURES", "ext2", "packagegroup-base-ext2", "", d)} \
            ${@bb.utils.contains("MACHINE_FEATURES", "vfat", "packagegroup-base-vfat", "", d)} \
            ${@bb.utils.contains("MACHINE_FEATURES", "irda", "packagegroup-base-irda", "",d)} \
            ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "packagegroup-base-keyboard", "", d)} \
            ... snip ...

  i'm guessing that one could shorten all that to:

PACKAGES = ' \
            ${PN} \
            ${PN}-extended \
            packagegroup-distro-base \
            packagegroup-machine-base \
            \
            ${@bb.utils.contains("MACHINE_FEATURES", "acpi", "${PN}-acpi", "",d)} \
            ${@bb.utils.contains("MACHINE_FEATURES", "alsa", "${PN}-alsa", "", d)} \
            ${@bb.utils.contains("MACHINE_FEATURES", "apm", "${PN}-apm", "", d)} \
            ${@bb.utils.contains("MACHINE_FEATURES", "ext2", "${PN}-ext2", "", d)} \
            ${@bb.utils.contains("MACHINE_FEATURES", "vfat", "${PN}-vfat", "", d)} \
            ${@bb.utils.contains("MACHINE_FEATURES", "irda", "${PN}-irda", "",d)} \
            ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "${PN}-keyboard", "", d)} \
            ... snip ...

so while most packagegroup files would just get a couple tweaked
lines, it's files like the above for which i asked whether this would
be just code churn. i'll let someone else make that decision.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================




More information about the Openembedded-core mailing list