diff options
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/package.bbclass | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index b579e50a32..266173cdf2 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass @@ -1065,6 +1065,13 @@ python emit_pkgdata() { f.write('%s: %s\n' % (var, encode(val))) return + def get_directory_size(dir): + if os.listdir(dir): + size = int(os.popen('du -sk %s' % dir).readlines()[0].split('\t')[0]) + else: + size = 0 + return size + packages = d.getVar('PACKAGES', True) pkgdest = d.getVar('PKGDEST', 1) pkgdatadir = d.getVar('PKGDESTWORK', True) @@ -1113,6 +1120,7 @@ python emit_pkgdata() { for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg, True) or "").split(): write_if_exists(sf, pkg, 'FILERDEPENDS_' + dfile) + sf.write('%s_%s: %s\n' % ('PKGSIZE', pkg, get_directory_size(pkgdest + "/%s" % pkg))) sf.close() |