[oe-commits] [openembedded-core] 43/43: package: don't count every hardlink for PKGSIZE

git at git.openembedded.org git at git.openembedded.org
Sat Dec 17 09:58:49 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit e82a7f879419828b42b5cc71e6229c8235090f21
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Fri Dec 16 18:06:20 2016 +0000

    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 ]
    
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/package.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 1f79188..e177e77 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1342,11 +1342,14 @@ python emit_pkgdata() {
         pkgdestpkg = os.path.join(pkgdest, pkg)
         files = {}
         total_size = 0
+        seen = set()
         for f in pkgfiles[pkg]:
             relpth = os.path.relpath(f, pkgdestpkg)
             fstat = os.lstat(f)
-            total_size += fstat.st_size
             files[os.sep + relpth] = fstat.st_size
+            if fstat.st_ino not in seen:
+                seen.add(fstat.st_ino)
+                total_size += fstat.st_size
         d.setVar('FILES_INFO', json.dumps(files))
 
         subdata_file = pkgdatadir + "/runtime/%s" % pkg

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list