Skip to contentSkip to conversation

Patch.bbclass URL Reasoning

DISCUSSION Robert Abel 1 participant 1 message Mar 21, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

Could somebody enlighten me why the following is done in patch.bbclass?

Quoted 4 lines

def src_patches(d, all = False ):
workdir = d.getVar('WORKDIR', True)
fetch = bb.fetch2.Fetch([], d)
patches = []

Quoted 8 lines

sources = []
for url in fetch.urls:
local = patch_path(url, fetch, workdir)
if not local:
if all:
local = fetch.localpath(url)
sources.append(local)
continue

As you can see (or guess), patches are resolved back to their original URLs inside the recipe folder. The ones that are copied to ${WORKDIR} during unpack don't seem to be used at all. Is there any special reason why this is done?

Basically, I was happily editing patches using sed when I noticed that my changes weren't applied at all. I thought the patches are copied to ${WORKDIR} precisely for the reason that they are used, i.e. can be edited before patching.

The reason for editing them in the first place is that they contain specific IDs (which I put there) that a task before do_patch replaces for actual values (e.g. MHz for external hardware) for the board configuration so my users will be able to simply change a variable inside their local.conf for added comfort/ease-of-use.

It seems the patches are copied just because and aren't actually utilized at all. Could this behavior be changed to use the copied patches instead of the original patches inside the recipe folder? IMHO it would make much more sense to be able to edit the patches before they are being applied without having to overwrite the original patches in the process.

Regards

Robert