diff options
-rw-r--r-- | meta/classes/buildhistory.bbclass | 13 | ||||
-rwxr-xr-x | scripts/oe-pkgdata-util | 26 |
2 files changed, 24 insertions, 15 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 |
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util index 8e22e020e7..a04e44d35a 100755 --- a/scripts/oe-pkgdata-util +++ b/scripts/oe-pkgdata-util | |||
@@ -161,8 +161,18 @@ def glob(args): | |||
161 | def read_value(args): | 161 | def read_value(args): |
162 | # Handle both multiple arguments and multiple values within an arg (old syntax) | 162 | # Handle both multiple arguments and multiple values within an arg (old syntax) |
163 | packages = [] | 163 | packages = [] |
164 | for pkgitem in args.pkg: | 164 | if args.file: |
165 | packages.extend(pkgitem.split()) | 165 | with open(args.file, 'r') as f: |
166 | for line in f: | ||
167 | splitline = line.split() | ||
168 | if splitline: | ||
169 | packages.append(splitline[0]) | ||
170 | else: | ||
171 | for pkgitem in args.pkg: | ||
172 | packages.extend(pkgitem.split()) | ||
173 | if not packages: | ||
174 | logger.error("No packages specified") | ||
175 | sys.exit(1) | ||
166 | 176 | ||
167 | def readvar(pkgdata_file, valuename): | 177 | def readvar(pkgdata_file, valuename): |
168 | val = "" | 178 | val = "" |
@@ -187,9 +197,13 @@ def read_value(args): | |||
187 | qvar = "%s_%s" % (args.valuename, mappedpkg) | 197 | qvar = "%s_%s" % (args.valuename, mappedpkg) |
188 | # PKGSIZE is now in bytes, but we we want it in KB | 198 | # PKGSIZE is now in bytes, but we we want it in KB |
189 | pkgsize = (int(readvar(revlink, qvar)) + 1024 // 2) // 1024 | 199 | pkgsize = (int(readvar(revlink, qvar)) + 1024 // 2) // 1024 |
190 | print("%d" % pkgsize) | 200 | value = "%d" % pkgsize |
201 | else: | ||
202 | value = readvar(revlink, qvar) | ||
203 | if args.prefix_name: | ||
204 | print('%s %s' % (pkg_name, value)) | ||
191 | else: | 205 | else: |
192 | print(readvar(revlink, qvar)) | 206 | print(value) |
193 | 207 | ||
194 | def lookup_pkglist(pkgs, pkgdata_dir, reverse): | 208 | def lookup_pkglist(pkgs, pkgdata_dir, reverse): |
195 | if reverse: | 209 | if reverse: |
@@ -465,7 +479,9 @@ def main(): | |||
465 | help='Read any pkgdata value for one or more packages', | 479 | help='Read any pkgdata value for one or more packages', |
466 | description='Reads the named value from the pkgdata files for the specified packages') | 480 | description='Reads the named value from the pkgdata files for the specified packages') |
467 | parser_read_value.add_argument('valuename', help='Name of the value to look up') | 481 | parser_read_value.add_argument('valuename', help='Name of the value to look up') |
468 | parser_read_value.add_argument('pkg', nargs='+', help='Runtime package name to look up') | 482 | parser_read_value.add_argument('pkg', nargs='*', help='Runtime package name to look up') |
483 | parser_read_value.add_argument('-f', '--file', help='Read package names from the specified file (one per line, first field only)') | ||
484 | parser_read_value.add_argument('-n', '--prefix-name', help='Prefix output with package name', action='store_true') | ||
469 | parser_read_value.set_defaults(func=read_value) | 485 | parser_read_value.set_defaults(func=read_value) |
470 | 486 | ||
471 | parser_glob = subparsers.add_parser('glob', | 487 | parser_glob = subparsers.add_parser('glob', |