Skip to content

[BBCLASS][AUTO-PATCH] Allow multiple patch source folders

Davide Cardillo requested to merge auto_patch_update into kirkstone

At the moment, the bbclass auto-path allow to declare a specific folder in which there is/are patch(s) to automatically include to a recipe that inherit this class, without explicitly list that/those patch(e) into SRC_URI file.

This is useful because other patch(s) can be added to the recipes only putting it/them into the declared folder, without changing the bb/bbappend file.

But there is a limitation: only one folder can be declared as patch source. 

This is a limitation because the situation has arisen that there are multiple meta layers that contain the bbappend of a recipe that inherits the auto-patch class. In this condition, only one meta layer can contain the patch folder source; but in the situation that occurred, all layers have to contain patches to be applied.

Solution: the variable PATCHPATH contain the path of the patch source folder. The solution is to convert this variable from a string to a vector of strings (vector of paths). In this way all patches, coming from those different folders, will be grouped together into SRC_URI variable, at runtime.

Note: since this solution uses PATCHPATH as list of paths, the list, itself, implicitly defines an order of with the patches will be applied. The application order is from the head to the tail of the folder list, and for each folder all files are shorted by its name.

Let explain the operation with the following example:

Folder1 |__ patch_b1 |__ patch_b2

Folder2 |__ patch_a1

Folder3 |__ patch_c1 |__ patch_c2 |__ patch_c3

in a meta layer with lowest priority PATCHPATH: = " Folder2 "

in a meta layer with middle priority PATCHPATH:append = " Folder3 "

in a meta layer with highest priority PATCHPATH:prepend = " Folder1 "


At runtime, the order in applying the patches is:

patch_b1 patch_b2 patch_a1 patch_c1 patch_c2 patch_c3

Merge request reports