summaryrefslogtreecommitdiffstats
path: root/meta/classes/buildhistory.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-04-04 17:02:19 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-05 14:33:57 +0100
commit4d364f27e76cba86155c29719710215249a231f0 (patch)
tree6d135af5d00095a5688f879411e0c8fc6e8af2c4 /meta/classes/buildhistory.bbclass
parentaf5f423887d1c41cf7279f6e537077726ae13082 (diff)
downloadpoky-4d364f27e76cba86155c29719710215249a231f0.tar.gz
classes/buildhistory: optimise getting package size list
Invoking oe-pkgdata-util in turn for every package in the list was slow with a large image. Modify oe-pkgdata-util's read-value command to take an option to read the list of packages from a file, as well as prefix the value with the package name; we can then use this to get all of the package sizes at once. This reduces the time to gather this information from minutes to just a second or two. Fixes [YOCTO #7339]. (From OE-Core rev: 51c24904cc1bc823bccc3f179b8d7a192dace168) Signed-off-by: Paul Eggleton <paul.eggleton@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.bbclass13
1 files changed, 3 insertions, 10 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 108275a460..8af36c5210 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -3,7 +3,7 @@
3# 3#
4# Based in part on testlab.bbclass and packagehistory.bbclass 4# Based in part on testlab.bbclass and packagehistory.bbclass
5# 5#
6# Copyright (C) 2011-2014 Intel Corporation 6# Copyright (C) 2011-2016 Intel Corporation
7# Copyright (C) 2007-2011 Koen Kooi <koen@openembedded.org> 7# Copyright (C) 2007-2011 Koen Kooi <koen@openembedded.org>
8# 8#
9 9
@@ -416,15 +416,8 @@ buildhistory_get_installed() {
416 rm $1/depends.tmp 416 rm $1/depends.tmp
417 417
418 # Produce installed package sizes list 418 # Produce installed package sizes list
419 printf "" > $1/installed-package-sizes.tmp 419 oe-pkgdata-util -p ${PKGDATA_DIR} read-value "PKGSIZE" -n -f $pkgcache > $1/installed-package-sizes.tmp
420 cat $pkgcache | while read pkg pkgfile pkgarch 420 cat $1/installed-package-sizes.tmp | awk '{print $2 "\tKiB " $1}' | sort -n -r > $1/installed-package-sizes.txt
421 do
422 size=`oe-pkgdata-util -p ${PKGDATA_DIR} read-value "PKGSIZE" ${pkg}_${pkgarch}`
423 if [ "$size" != "" ] ; then
424 echo "$size $pkg" >> $1/installed-package-sizes.tmp
425 fi
426 done
427 cat $1/installed-package-sizes.tmp | sort -n -r | awk '{print $1 "\tKiB " $2}' > $1/installed-package-sizes.txt
428 rm $1/installed-package-sizes.tmp 421 rm $1/installed-package-sizes.tmp
429 422
430 # We're now done with the cache, delete it 423 # We're now done with the cache, delete it