Skip to contentSkip to conversation

classes/buildhistory: actually use KiB in extensible SDK sizes files

PATCH New Paul Eggleton 1 participant 2 messages Jan 5, 2016

lore
Share & tools
lore
#0 lore raw

cover classes/buildhistory: actually use KiB in extensible SDK sizes files

Fix a minor mistake in my recent buildhistory extensible SDK changes.

The following changes since commit 1568f4fa1c8f8abd9b365ecd264841cd4f6b66b1:

bluez5: include the patch only for 5.36 (2015-12-28 13:02:03 +0000)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib paule/buildhistory-sdk-kib
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/buildhistory-sdk-kib

Paul Eggleton (1):
classes/buildhistory: actually use KiB in extensible SDK sizes files

 meta/classes/buildhistory.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/1 classes/buildhistory: actually use KiB in extensible SDK sizes files

I was using bytes here for the sizes and writing out KiB as the suffix. Change it to actually write out size values in KiB.

---
 meta/classes/buildhistory.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/buildhistory.bbclass +2 -1
index 943c8d7..4153e58 100644
@@ -531,13 +531,14 @@ END
 
 python buildhistory_get_extra_sdkinfo() {
     import operator
+    import math
     if d.getVar('BB_CURRENTTASK', True) == 'populate_sdk_ext':
         tasksizes = {}
         filesizes = {}
         for root, _, files in os.walk('${SDK_OUTPUT}/${SDKPATH}/sstate-cache'):
             for fn in files:
                 if fn.endswith('.tgz'):
-                    fsize = os.path.getsize(os.path.join(root, fn))
+                    fsize = int(math.ceil(float(os.path.getsize(os.path.join(root, fn))) / 1024))
                     task = fn.rsplit(':', 1)[1].split('_', 1)[1].split('.')[0]
                     origtotal = tasksizes.get(task, 0)
                     tasksizes[task] = origtotal + fsize
Signature · 1 line
2.5.0