diff options
author | Antonin Godard <antoningodard@pm.me> | 2023-05-16 15:56:39 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-05-25 10:29:04 +0100 |
commit | 292c626526b2ba6d3a66463c0c7ab59eb8903ab4 (patch) | |
tree | 2012da2ada080c3556f0dea9825c0f372109e414 /meta/classes | |
parent | 7a111ff58d7390b79e2e63c8059f6c25f40f8977 (diff) | |
download | openembedded-core-contrib-292c626526b2ba6d3a66463c0c7ab59eb8903ab4.tar.gz |
archiver: move exclusion logic in a dedicated function
Extending archiver is not possible without duplicating the anonymous
function's logic. Move this logic in a separate function
"include_package" which returns a bool.
Signed-off-by: Antonin Godard <antoningodard@pm.me>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/archiver.bbclass | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass index 4049694d85..0eee1abefa 100644 --- a/meta/classes/archiver.bbclass +++ b/meta/classes/archiver.bbclass @@ -76,33 +76,39 @@ do_ar_original[dirs] = "${ARCHIVER_OUTDIR} ${ARCHIVER_WORKDIR}" # This is a convenience for the shell script to use it - -python () { - pn = d.getVar('PN') - assume_provided = (d.getVar("ASSUME_PROVIDED") or "").split() - if pn in assume_provided: - for p in d.getVar("PROVIDES").split(): - if p != pn: - pn = p - break +def include_package(d, pn): included, reason = copyleft_should_include(d) if not included: bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason)) - return + return False + else: bb.debug(1, 'archiver: %s is included: %s' % (pn, reason)) - # glibc-locale: do_fetch, do_unpack and do_patch tasks have been deleted, # so avoid archiving source here. if pn.startswith('glibc-locale'): - return + return False # We just archive gcc-source for all the gcc related recipes if d.getVar('BPN') in ['gcc', 'libgcc'] \ and not pn.startswith('gcc-source'): bb.debug(1, 'archiver: %s is excluded, covered by gcc-source' % pn) + return False + + return True + +python () { + pn = d.getVar('PN') + assume_provided = (d.getVar("ASSUME_PROVIDED") or "").split() + if pn in assume_provided: + for p in d.getVar("PROVIDES").split(): + if p != pn: + pn = p + break + + if not include_package(d, pn): return # TARGET_SYS in ARCHIVER_ARCH will break the stamp for gcc-source in multiconfig |