diff options
author | Etienne Buira <etienne.buira@free.fr> | 2024-11-02 16:18:34 +0100 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2024-11-02 08:47:01 -0700 |
commit | 33e5f70ec3ec7334d646daf1cf18a22fec8faf39 (patch) | |
tree | bd4745e37ccfdccf2bf6451e4e2afbcf676e6995 | |
parent | gpkg: avoid os.path.islink where lstat is available (diff) | |
download | portage-33e5f70ec3ec7334d646daf1cf18a22fec8faf39.tar.gz portage-33e5f70ec3ec7334d646daf1cf18a22fec8faf39.tar.bz2 portage-33e5f70ec3ec7334d646daf1cf18a22fec8faf39.zip |
gpkg: use already queried size instead of syscall
Signed-off-by: Etienne Buira <etienne.buira@free.fr>
Bug: https://bugs.gentoo.org/942512
Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r-- | lib/portage/gpkg.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/portage/gpkg.py b/lib/portage/gpkg.py index c4a2666bc..e9347919c 100644 --- a/lib/portage/gpkg.py +++ b/lib/portage/gpkg.py @@ -1963,7 +1963,7 @@ class gpkg: if stat.S_ISLNK(file_stat.st_mode): continue - file_size = os.path.getsize(f) + file_size = file_stat.st_size image_total_size += file_size image_max_file_size = max(image_max_file_size, file_size) @@ -2054,7 +2054,7 @@ class gpkg: if stat.S_ISLNK(file_stat.st_mode): continue - file_size = os.path.getsize(path) + file_size = file_stat.st_size image_total_size += file_size if file_size > image_max_file_size: image_max_file_size = file_size |