summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/archiver.bbclass27
1 files changed, 20 insertions, 7 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index eec8024db7..41a552c76b 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -157,7 +157,7 @@ python do_ar_patched() {
157 # Get the ARCHIVER_OUTDIR before we reset the WORKDIR 157 # Get the ARCHIVER_OUTDIR before we reset the WORKDIR
158 ar_outdir = d.getVar('ARCHIVER_OUTDIR', True) 158 ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
159 bb.note('Archiving the patched source...') 159 bb.note('Archiving the patched source...')
160 d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR', True)) 160 d.setVar('WORKDIR', ar_outdir)
161 create_tarball(d, d.getVar('S', True), 'patched', ar_outdir) 161 create_tarball(d, d.getVar('S', True), 'patched', ar_outdir)
162} 162}
163 163
@@ -202,6 +202,10 @@ def create_tarball(d, srcdir, suffix, ar_outdir):
202 """ 202 """
203 import tarfile 203 import tarfile
204 204
205 # Make sure we are only creating a single tarball for gcc sources
206 if d.getVar('SRC_URI', True) == "" and 'gcc' in d.getVar('PN', True):
207 return
208
205 bb.utils.mkdirhier(ar_outdir) 209 bb.utils.mkdirhier(ar_outdir)
206 tarname = os.path.join(ar_outdir, '%s-%s.tar.gz' % \ 210 tarname = os.path.join(ar_outdir, '%s-%s.tar.gz' % \
207 (d.getVar('PF', True), suffix)) 211 (d.getVar('PF', True), suffix))
@@ -246,11 +250,9 @@ python do_unpack_and_patch() {
246 [ 'patched', 'configured'] and \ 250 [ 'patched', 'configured'] and \
247 d.getVarFlag('ARCHIVER_MODE', 'diff', True) != '1': 251 d.getVarFlag('ARCHIVER_MODE', 'diff', True) != '1':
248 return 252 return
249
250 ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
251
252 # Change the WORKDIR to make do_unpack do_patch run in another dir. 253 # Change the WORKDIR to make do_unpack do_patch run in another dir.
253 d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR', True)) 254 ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
255 d.setVar('WORKDIR', ar_outdir)
254 256
255 # The changed 'WORKDIR' also casued 'B' changed, create dir 'B' for the 257 # The changed 'WORKDIR' also casued 'B' changed, create dir 'B' for the
256 # possibly requiring of the following tasks (such as some recipes's 258 # possibly requiring of the following tasks (such as some recipes's
@@ -270,7 +272,11 @@ python do_unpack_and_patch() {
270 src = d.getVar('S', True).rstrip('/') 272 src = d.getVar('S', True).rstrip('/')
271 src_orig = '%s.orig' % src 273 src_orig = '%s.orig' % src
272 oe.path.copytree(src, src_orig) 274 oe.path.copytree(src, src_orig)
273 bb.build.exec_func('do_patch', d) 275
276 # Make sure gcc sources are patched only once
277 if not ((d.getVar('SRC_URI', True) == "" and 'gcc' in d.getVar('PN', True))):
278 bb.build.exec_func('do_patch', d)
279
274 # Create the patches 280 # Create the patches
275 if d.getVarFlag('ARCHIVER_MODE', 'diff', True) == '1': 281 if d.getVarFlag('ARCHIVER_MODE', 'diff', True) == '1':
276 bb.note('Creating diff gz...') 282 bb.note('Creating diff gz...')
@@ -341,7 +347,6 @@ do_deploy_archives[sstate-inputdirs] = "${ARCHIVER_TOPDIR}"
341do_deploy_archives[sstate-outputdirs] = "${DEPLOY_DIR_SRC}" 347do_deploy_archives[sstate-outputdirs] = "${DEPLOY_DIR_SRC}"
342 348
343addtask do_ar_original after do_unpack 349addtask do_ar_original after do_unpack
344addtask do_unpack_and_patch after do_patch
345addtask do_ar_patched after do_unpack_and_patch 350addtask do_ar_patched after do_unpack_and_patch
346addtask do_ar_configured after do_unpack_and_patch 351addtask do_ar_configured after do_unpack_and_patch
347addtask do_dumpdata 352addtask do_dumpdata
@@ -354,3 +359,11 @@ do_deploy_all_archives[recideptask] = "do_${BB_DEFAULT_TASK}"
354do_deploy_all_archives() { 359do_deploy_all_archives() {
355 : 360 :
356} 361}
362
363python () {
364 # Add tasks in the correct order, specifically for linux-yocto to avoid race condition
365 if bb.data.inherits_class('kernel-yocto', d):
366 bb.build.addtask('do_kernel_configme', 'do_configure', 'do_unpack_and_patch', d)
367 else:
368 bb.build.addtask('do_unpack_and_patch', None, 'do_patch', d)
369}