summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonin Godard <antoningodard@pm.me>2023-05-16 15:56:39 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-05-25 10:29:08 +0100
commit08c4b7f46d0992c90619c2484e676309a5f5b36e (patch)
tree0d398587b1a00170e7b3f196f6c896bbfed56dcf
parent08d26fb3755935ec9247e99f657960c9d68da7a6 (diff)
downloadpoky-08c4b7f46d0992c90619c2484e676309a5f5b36e.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. (From OE-Core rev: 292c626526b2ba6d3a66463c0c7ab59eb8903ab4) 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>
-rw-r--r--meta/classes/archiver.bbclass30
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}"
76 76
77# This is a convenience for the shell script to use it 77# This is a convenience for the shell script to use it
78 78
79 79def include_package(d, pn):
80python () {
81 pn = d.getVar('PN')
82 assume_provided = (d.getVar("ASSUME_PROVIDED") or "").split()
83 if pn in assume_provided:
84 for p in d.getVar("PROVIDES").split():
85 if p != pn:
86 pn = p
87 break
88 80
89 included, reason = copyleft_should_include(d) 81 included, reason = copyleft_should_include(d)
90 if not included: 82 if not included:
91 bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason)) 83 bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason))
92 return 84 return False
85
93 else: 86 else:
94 bb.debug(1, 'archiver: %s is included: %s' % (pn, reason)) 87 bb.debug(1, 'archiver: %s is included: %s' % (pn, reason))
95 88
96
97 # glibc-locale: do_fetch, do_unpack and do_patch tasks have been deleted, 89 # glibc-locale: do_fetch, do_unpack and do_patch tasks have been deleted,
98 # so avoid archiving source here. 90 # so avoid archiving source here.
99 if pn.startswith('glibc-locale'): 91 if pn.startswith('glibc-locale'):
100 return 92 return False
101 93
102 # We just archive gcc-source for all the gcc related recipes 94 # We just archive gcc-source for all the gcc related recipes
103 if d.getVar('BPN') in ['gcc', 'libgcc'] \ 95 if d.getVar('BPN') in ['gcc', 'libgcc'] \
104 and not pn.startswith('gcc-source'): 96 and not pn.startswith('gcc-source'):
105 bb.debug(1, 'archiver: %s is excluded, covered by gcc-source' % pn) 97 bb.debug(1, 'archiver: %s is excluded, covered by gcc-source' % pn)
98 return False
99
100 return True
101
102python () {
103 pn = d.getVar('PN')
104 assume_provided = (d.getVar("ASSUME_PROVIDED") or "").split()
105 if pn in assume_provided:
106 for p in d.getVar("PROVIDES").split():
107 if p != pn:
108 pn = p
109 break
110
111 if not include_package(d, pn):
106 return 112 return
107 113
108 # TARGET_SYS in ARCHIVER_ARCH will break the stamp for gcc-source in multiconfig 114 # TARGET_SYS in ARCHIVER_ARCH will break the stamp for gcc-source in multiconfig