On Mon, Mar 22, 2021 at 11:43 AM Robert P. J. Day <rpj...@crashcourse.ca> wrote: > (warning: i've just been handed an existing OE code base, and i'm > going to ask some questions about some head-scratching things i'm > finding in it, so be prepared for weird questions.) > > in one recipe, i see the following snippet: > > FILES_${PN} += "/etc" > FILES_${PN} += "/etc/mosquitto" > FILES_${PN} += "/etc/mosquitto/config" > ... etc etc ... > > first, i'm taken aback by the hardcoding of "/etc" rather than using, > you know, "${sysconfdir}", so i'm *assuming* that unless someone was > doing something spectacularly clever here, that just can't be right.
Nothing clever going on, it's just a bug. In general, using /etc instead of ${sysconfdir} etc will appear to work fine until you add BBCLASSEXTEND and try to build <recipe>-native, at which point things will start to fail in mysterious ways (since native.bbclass over-rides the default values of ${sysconfdir} etc). In this particular case, you might still get away with it since FILES_${PN} is related to packaging and -native recipes don't do any packaging but it's still not right. > more to the point, the above seems redundant -- once you've added > "/etc", isn't the rest just superfluous? i'm not sure what the > original developer was going for here. thoughts? Yes, and even beyond that, ${sysconfdir} is handled by the default packaging rules, so any extra packaging rules related to adding files from /etc to the default package are redundant. > finally, if i wanted to add all of some directory, say "dir", it was > my understanding that all of the following were equivalent (hmmmm, > short of picking up hidden files, i guess): > > dir > dir/ > dir/* > > my personal preference would be "dir/", as it gets across the idea > that "dir" is a directory and i want all of it. thoughts on that as > well? i'm currently perusing the OE code base to see the general > consensus on this. is there one? That's more a question of coding style, which the OE maintainers etc generally doesn't care about very much (unless you start asking about unifying oe-core and meta-oe with respect to indenting with tabs or spaces...). > more decidedly strange questions coming shortly ... > > rday > > > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#149795): https://lists.openembedded.org/g/openembedded-core/message/149795 Mute This Topic: https://lists.openembedded.org/mt/81532778/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-