diff options
author | Francisco Pedraza <francisco.j.pedraza.gonzalez@intel.com> | 2017-06-09 12:01:25 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-12 23:01:23 +0100 |
commit | 08a4705af9cc677b32fd6489e67f86f7e9d6e92c (patch) | |
tree | 03cdaa92fb63a2d07afa8bf8e9490134e2010145 /meta/classes/buildhistory.bbclass | |
parent | 246b73ad553dfe8d52da750e0341a99e13926294 (diff) | |
download | poky-08a4705af9cc677b32fd6489e67f86f7e9d6e92c.tar.gz |
lib/oe/sdk: Adds get_extra_sdk_info to reuse code in buildhistory
This function is going to be used for generating the target and host
manifest files packages for eSDK. Added some fixes for buildhistory.bblclass,
and docstring for get_extra_sdkinfo at oe.sdk
[YOCTO #9038]
(From OE-Core rev: f696b3bbe01969ce7ecb8174d63d3e1e172b473e)
Signed-off-by: Francisco Pedraza <francisco.j.pedraza.gonzalez@intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/buildhistory.bbclass')
-rw-r--r-- | meta/classes/buildhistory.bbclass | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index c26dffc058..779a1a67e0 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
@@ -590,25 +590,19 @@ END | |||
590 | python buildhistory_get_extra_sdkinfo() { | 590 | python buildhistory_get_extra_sdkinfo() { |
591 | import operator | 591 | import operator |
592 | import math | 592 | import math |
593 | from oe.sdk import get_extra_sdkinfo | ||
594 | |||
595 | sstate_dir = d.expand('${SDK_OUTPUT}/${SDKPATH}/sstate-cache') | ||
596 | extra_info = get_extra_sdkinfo(sstate_dir) | ||
593 | 597 | ||
594 | if d.getVar('BB_CURRENTTASK') == 'populate_sdk_ext' and \ | 598 | if d.getVar('BB_CURRENTTASK') == 'populate_sdk_ext' and \ |
595 | "sdk" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): | 599 | "sdk" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): |
596 | tasksizes = {} | ||
597 | filesizes = {} | ||
598 | for root, _, files in os.walk(d.expand('${SDK_OUTPUT}/${SDKPATH}/sstate-cache')): | ||
599 | for fn in files: | ||
600 | if fn.endswith('.tgz'): | ||
601 | fsize = int(math.ceil(float(os.path.getsize(os.path.join(root, fn))) / 1024)) | ||
602 | task = fn.rsplit(':', 1)[1].split('_', 1)[1].split('.')[0] | ||
603 | origtotal = tasksizes.get(task, 0) | ||
604 | tasksizes[task] = origtotal + fsize | ||
605 | filesizes[fn] = fsize | ||
606 | with open(d.expand('${BUILDHISTORY_DIR_SDK}/sstate-package-sizes.txt'), 'w') as f: | 600 | with open(d.expand('${BUILDHISTORY_DIR_SDK}/sstate-package-sizes.txt'), 'w') as f: |
607 | filesizes_sorted = sorted(filesizes.items(), key=operator.itemgetter(1, 0), reverse=True) | 601 | filesizes_sorted = sorted(extra_info['filesizes'].items(), key=operator.itemgetter(1, 0), reverse=True) |
608 | for fn, size in filesizes_sorted: | 602 | for fn, size in filesizes_sorted: |
609 | f.write('%10d KiB %s\n' % (size, fn)) | 603 | f.write('%10d KiB %s\n' % (size, fn)) |
610 | with open(d.expand('${BUILDHISTORY_DIR_SDK}/sstate-task-sizes.txt'), 'w') as f: | 604 | with open(d.expand('${BUILDHISTORY_DIR_SDK}/sstate-task-sizes.txt'), 'w') as f: |
611 | tasksizes_sorted = sorted(tasksizes.items(), key=operator.itemgetter(1, 0), reverse=True) | 605 | tasksizes_sorted = sorted(extra_info['tasksizes'].items(), key=operator.itemgetter(1, 0), reverse=True) |
612 | for task, size in tasksizes_sorted: | 606 | for task, size in tasksizes_sorted: |
613 | f.write('%10d KiB %s\n' % (size, task)) | 607 | f.write('%10d KiB %s\n' % (size, task)) |
614 | } | 608 | } |