summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-10 00:07:05 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-10 14:38:45 +0000
commitd60912993d8542883d2930101b5b9a21ecb6adc0 (patch)
treec5357b29d20280a32c2547300e91296b33108634 /meta/classes
parent765547eb713c1b114ea8dd74e4f33ef5cc68bbff (diff)
downloadpoky-d60912993d8542883d2930101b5b9a21ecb6adc0.tar.gz
sstate.bbclass: Optimise sstate_hardcode_path
The sstate_hardcode_path() function triggered large numbers of exec() calls when processing packages with large numbers of file relocations (e.g. perl). This patch optimises those calls into longer single commands which make the code significantly more efficient. This reduced the do_package time for perl by 2 minutes (from 4.75 minutes) for me. (From OE-Core rev: 4159ff761cf29a03aeb56c7686a4e7af02b52219) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/sstate.bbclass27
1 files changed, 16 insertions, 11 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 4bd3712e57..d4f95c1d9f 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -317,19 +317,24 @@ def sstate_hardcode_path(d):
317 staging_host = d.getVar('STAGING_DIR_HOST', True) 317 staging_host = d.getVar('STAGING_DIR_HOST', True)
318 sstate_builddir = d.getVar('SSTATE_BUILDDIR', True) 318 sstate_builddir = d.getVar('SSTATE_BUILDDIR', True)
319 319
320 for i in file_list.split('\n'): 320 files = " ".join(file_list.split('\n'))
321 if not i:
322 continue
323 if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d):
324 cmd = "sed -i -e s:%s:FIXMESTAGINGDIR:g %s" % (staging, i)
325 elif bb.data.inherits_class('cross', d):
326 cmd = "sed -i -e s:%s:FIXMESTAGINGDIRTARGET:g %s \
327 sed -i -e s:%s:FIXMESTAGINGDIR:g %s" % (staging_target, i, staging, i)
328 else:
329 cmd = "sed -i -e s:%s:FIXMESTAGINGDIRHOST:g %s" % (staging_host, i)
330 321
322 if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d):
323 cmd = "sed -i -e s:%s:FIXMESTAGINGDIR:g %s" % (staging, files)
324 elif bb.data.inherits_class('cross', d):
325 cmd = "sed -i -e s:%s:FIXMESTAGINGDIRTARGET:g %s \
326 sed -i -e s:%s:FIXMESTAGINGDIR:g %s" % (staging_target, files, staging, files)
327 else:
328 cmd = "sed -i -e s:%s:FIXMESTAGINGDIRHOST:g %s" % (staging_host, files)
329
330 if files:
331 os.system(cmd) 331 os.system(cmd)
332 os.system("echo %s | sed -e 's:%s::' >> %sfixmepath" % (i, sstate_builddir, sstate_builddir)) 332 fix = open("%sfixmepath" % (sstate_builddir), "w")
333 fixme = []
334 for f in file_list.split('\n'):
335 fixme.append(f.replace(sstate_builddir, ""))
336 fix.write("\n".join(fixme))
337 fix.close()
333 p.close() 338 p.close()
334 339
335def sstate_package(ss, d): 340def sstate_package(ss, d):