[poky] Patch.bbclass URL Reasoning
Robert Abel
abel at uni-bielefeld.de
Wed Mar 21 10:18:31 PDT 2012
Hi,
Could somebody enlighten me why the following is done in patch.bbclass?
> def src_patches(d, all = False ):
> workdir = d.getVar('WORKDIR', True)
> fetch = bb.fetch2.Fetch([], d)
> patches = []
> 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
More information about the poky
mailing list