aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2024-11-02 15:10:44 -0700
committerZac Medico <zmedico@gentoo.org>2024-11-02 15:11:47 -0700
commitac88048bb1d6a28dbd415223e2e0fc3ec8b16a6c (patch)
tree14ee82ac00f48f89ac0b62bd4feb18ec503ab985 /lib
parentgpkg: use already queried size instead of syscall (diff)
downloadportage-ac88048bb1d6a28dbd415223e2e0fc3ec8b16a6c.tar.gz
portage-ac88048bb1d6a28dbd415223e2e0fc3ec8b16a6c.tar.bz2
portage-ac88048bb1d6a28dbd415223e2e0fc3ec8b16a6c.zip
gpkg: Fix S_ISLNK usage
Fixes: 320df528974c ("gpkg: avoid os.path.islink where lstat is available") Bug: https://bugs.gentoo.org/942512 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/portage/gpkg.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/portage/gpkg.py b/lib/portage/gpkg.py
index e9347919c..53785c271 100644
--- a/lib/portage/gpkg.py
+++ b/lib/portage/gpkg.py
@@ -1943,7 +1943,7 @@ class gpkg:
file_stat = os.lstat(f)
- if stat.S_ISLNK(file_stat):
+ if stat.S_ISLNK(file_stat.st_mode):
path_link = os.readlink(f)
path_link_length = len(
os.fsencode(path_link)
@@ -2035,7 +2035,7 @@ class gpkg:
file_stat = os.lstat(path)
- if stat.S_ISLNK(file_stat):
+ if stat.S_ISLNK(file_stat.st_mode):
path_link = os.readlink(path)
path_link_length = len(
_unicode_encode(