diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-08-08 19:24:56 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-08-08 19:24:56 +0000 |
commit | 9aca761850fa82997dbcd04cb06a203b7b326ea3 (patch) | |
tree | 5afae256d574a8fb181153818b4377882a6a8d08 | |
parent | 210e59514504bd95e63189eceebc32284542d0fa (diff) | |
download | portage-9aca761850fa82997dbcd04cb06a203b7b326ea3.tar.gz portage-9aca761850fa82997dbcd04cb06a203b7b326ea3.tar.bz2 portage-9aca761850fa82997dbcd04cb06a203b7b326ea3.zip |
Account for hardlinks when computing SIZE metadata.
svn path=/main/trunk/; revision=13949
-rw-r--r-- | pym/portage/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index af908f041..321487a1c 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -5176,12 +5176,15 @@ def _post_src_install_uid_fix(mysettings): destdir = destdir.encode('utf_8', 'replace') size = 0 + counted_inodes = set() for parent, dirs, files in os.walk(destdir): for fname in chain(dirs, files): fpath = os.path.join(parent, fname) mystat = os.lstat(fpath) - if stat.S_ISREG(mystat.st_mode): + if stat.S_ISREG(mystat.st_mode) and \ + mystat.st_ino not in counted_inodes: + counted_inodes.add(mystat.st_ino) size += mystat.st_size if mystat.st_uid != portage_uid and \ mystat.st_gid != portage_gid: |