commit: 33e5f70ec3ec7334d646daf1cf18a22fec8faf39 Author: Etienne Buira <etienne.buira <AT> free <DOT> fr> AuthorDate: Sat Nov 2 15:18:34 2024 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Sat Nov 2 15:47:01 2024 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=33e5f70e
gpkg: use already queried size instead of syscall Signed-off-by: Etienne Buira <etienne.buira <AT> free.fr> Bug: https://bugs.gentoo.org/942512 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> lib/portage/gpkg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/portage/gpkg.py b/lib/portage/gpkg.py index c4a2666bc5..e9347919cc 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