From 430acc87de097495d003e42826f2477a6c2f3990 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sat, 16 Mar 2024 07:29:31 -0400 Subject: [PATCH] Fix symlink package spec validation (#4870) When validating symlink:// packages, use the specified symlink path, the same as for file:// packages. This fixes missing symlink packages in 'pkg list' and reinstalling on every build. --- platformio/package/manager/base.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/platformio/package/manager/base.py b/platformio/package/manager/base.py index f197ea12..cfb49ebc 100644 --- a/platformio/package/manager/base.py +++ b/platformio/package/manager/base.py @@ -281,9 +281,16 @@ class BasePackageManager( # pylint: disable=too-many-public-methods,too-many-in # external "URL" mismatch if spec.external: # local folder mismatch - if os.path.abspath(spec.uri) == os.path.abspath(pkg.path) or ( - spec.uri.startswith("file://") - and os.path.abspath(pkg.path) == os.path.abspath(spec.uri[7:]) + if ( + os.path.abspath(spec.uri) == os.path.abspath(pkg.path) + or ( + spec.uri.startswith("file://") + and os.path.abspath(pkg.path) == os.path.abspath(spec.uri[7:]) + ) + or ( + spec.uri.startswith("symlink://") + and os.path.abspath(pkg.path) == os.path.abspath(spec.uri[10:]) + ) ): return True if spec.uri != pkg.metadata.spec.uri: