diff options
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/package.bbclass | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index cce2499122..2eb970dac5 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -1127,14 +1127,6 @@ python emit_pkgdata() { | |||
1127 | f.write('%s: %s\n' % (var, encode(val))) | 1127 | f.write('%s: %s\n' % (var, encode(val))) |
1128 | return | 1128 | return |
1129 | 1129 | ||
1130 | def get_directory_size(dir): | ||
1131 | if os.listdir(dir): | ||
1132 | with os.popen('du -sk %s' % dir) as f: | ||
1133 | size = int(f.readlines()[0].split('\t')[0]) | ||
1134 | else: | ||
1135 | size = 0 | ||
1136 | return size | ||
1137 | |||
1138 | def write_extra_pkgs(variants, pn, packages, pkgdatadir): | 1130 | def write_extra_pkgs(variants, pn, packages, pkgdatadir): |
1139 | for variant in variants: | 1131 | for variant in variants: |
1140 | with open("%s/%s-%s" % (pkgdatadir, variant, pn), 'w') as fd: | 1132 | with open("%s/%s-%s" % (pkgdatadir, variant, pn), 'w') as fd: |
@@ -1181,9 +1173,11 @@ python emit_pkgdata() { | |||
1181 | 1173 | ||
1182 | pkgdestpkg = os.path.join(pkgdest, pkg) | 1174 | pkgdestpkg = os.path.join(pkgdest, pkg) |
1183 | files = {} | 1175 | files = {} |
1176 | total_size = 0 | ||
1184 | for f in pkgfiles[pkg]: | 1177 | for f in pkgfiles[pkg]: |
1185 | relpth = os.path.relpath(f, pkgdestpkg) | 1178 | relpth = os.path.relpath(f, pkgdestpkg) |
1186 | fstat = os.lstat(f) | 1179 | fstat = os.lstat(f) |
1180 | total_size += fstat.st_size | ||
1187 | files[os.sep + relpth] = fstat.st_size | 1181 | files[os.sep + relpth] = fstat.st_size |
1188 | d.setVar('FILES_INFO', json.dumps(files)) | 1182 | d.setVar('FILES_INFO', json.dumps(files)) |
1189 | 1183 | ||
@@ -1220,7 +1214,7 @@ python emit_pkgdata() { | |||
1220 | for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg, True) or "").split(): | 1214 | for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg, True) or "").split(): |
1221 | write_if_exists(sf, pkg, 'FILERDEPENDS_' + dfile) | 1215 | write_if_exists(sf, pkg, 'FILERDEPENDS_' + dfile) |
1222 | 1216 | ||
1223 | sf.write('%s_%s: %s\n' % ('PKGSIZE', pkg, get_directory_size(pkgdest + "/%s" % pkg))) | 1217 | sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size)) |
1224 | sf.close() | 1218 | sf.close() |
1225 | 1219 | ||
1226 | # Symlinks needed for reverse lookups (from the final package name) | 1220 | # Symlinks needed for reverse lookups (from the final package name) |