summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-12-16 18:06:20 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-17 09:57:05 +0000
commit7379035e2653be8bf632f767706f48244c0ff970 (patch)
tree8a6a9d4114b40800a181f0c1c55c1aeb6338ceff /meta/classes/package.bbclass
parent676add9a9bdf72529ca4a3d6f96d9c3688fc4e38 (diff)
downloadpoky-7379035e2653be8bf632f767706f48244c0ff970.tar.gz
package: don't count every hardlink for PKGSIZE
When calculating PKGSIZE we sum the size of files after doing lstat() so we don't count directory metadata overhead, but were not correctly handling hardlinks. This results in packages such as e2fsprogs-mke2fs having PKGSIZE of 1.5M when it's actually a single 300K binary with five hardlinks. [ YOCTO #10423 ] (From OE-Core rev: e82a7f879419828b42b5cc71e6229c8235090f21) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass5
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 1f79188236..e177e775e5 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1342,11 +1342,14 @@ python emit_pkgdata() {
1342 pkgdestpkg = os.path.join(pkgdest, pkg) 1342 pkgdestpkg = os.path.join(pkgdest, pkg)
1343 files = {} 1343 files = {}
1344 total_size = 0 1344 total_size = 0
1345 seen = set()
1345 for f in pkgfiles[pkg]: 1346 for f in pkgfiles[pkg]:
1346 relpth = os.path.relpath(f, pkgdestpkg) 1347 relpth = os.path.relpath(f, pkgdestpkg)
1347 fstat = os.lstat(f) 1348 fstat = os.lstat(f)
1348 total_size += fstat.st_size
1349 files[os.sep + relpth] = fstat.st_size 1349 files[os.sep + relpth] = fstat.st_size
1350 if fstat.st_ino not in seen:
1351 seen.add(fstat.st_ino)
1352 total_size += fstat.st_size
1350 d.setVar('FILES_INFO', json.dumps(files)) 1353 d.setVar('FILES_INFO', json.dumps(files))
1351 1354
1352 subdata_file = pkgdatadir + "/runtime/%s" % pkg 1355 subdata_file = pkgdatadir + "/runtime/%s" % pkg