From 29615b36fca696822a715ece2afbe0bf9a43ed61 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 2 Dec 2013 18:50:45 +0000 Subject: classes/package: record PKGSIZE as total file size in pkgdata We were using "du -sk" to collect the total size of all files in each package for writing out to PKGSIZE in each pkgdata file; however this reports the total space used on disk not the total size of all files, which means it is dependent on the block size and filesystem being used for TMPDIR on the build host. Instead, take the total of the size reported by lstat() for each packaged file, which we are already collecting for FILES_INFO in any case. Note: this changes PKGSIZE to be reported in bytes instead of kilobytes since this is what lstat reports, but this is really what we should be storing anyway so that we have the precision if we need it. Fixes [YOCTO #5334] Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- scripts/oe-pkgdata-util | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util index 03c8f95305..a373116b2c 100755 --- a/scripts/oe-pkgdata-util +++ b/scripts/oe-pkgdata-util @@ -184,7 +184,11 @@ def read_value(args, usage, debug=False): if qvar == "PKGSIZE": # append packagename qvar = "%s_%s" % (var, mappedpkg) - print(readvar(revlink, qvar)) + # PKGSIZE is now in bytes, but we we want it in KB + pkgsize = (int(readvar(revlink, qvar)) + 1024 // 2) // 1024 + print("%d" % pkgsize) + else: + print(readvar(revlink, qvar)) def lookup_pkg(args, usage, debug=False): if len(args) < 2: -- cgit 1.2.3-korg