Re: Best convention for FILES variable

Chuck Wolber

On Sat, Nov 21, 2020 at 12:21 AM Chuck Wolber <chuckwolber@...> wrote:

%< SNIP %<
And finally, I have adjusted to using the following pattern, and found that it has improved maintainability a great deal. It applies to DEPENDS and RDEPENDS as well. Yes, it is a bit tedious, but the benefits far outweigh the cost (IMHO).

FILES_fooz += " lib/"
FILES_fooz += " /usr/lib/"
FILES_fooz += " /usr/bin/fooz"
FILES_fooz += " /bin/fooz"
FILES_fooz += " /usr/share/fooz"

This pattern is invaluable when you start accumulating a lot of recipes. A recursive grep (grep -r) across a directory tree, will immediately tell you that (for example), /bin/fooz is file in the fooz package and it is referenced in the recipe.

I forgot one other benefit. When a change is made to a recipe that uses that pattern, the (Git) commit diff is a lot clearer and easier to understand.

Think of it this way... Use your pattern, but imagine there are a lot more entries in your list. A change to the middle of that list is going to result in a diff that is hard to determine if it is a FILE_fooz entry or a DEPENDS_${PN} entry. Prefixing with the directive keeps your Git history a lot clearer.

"Perfection must be reached by degrees; she requires the slow hand of time." - Voltaire

Join to automatically receive all group messages.