Skip to content

Commit 430acc8

Browse files
authored
Fix symlink package spec validation (platformio#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.
1 parent c0d9728 commit 430acc8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

platformio/package/manager/base.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,16 @@ def test_pkg_spec(pkg, spec):
281281
# external "URL" mismatch
282282
if spec.external:
283283
# local folder mismatch
284-
if os.path.abspath(spec.uri) == os.path.abspath(pkg.path) or (
285-
spec.uri.startswith("file://")
286-
and os.path.abspath(pkg.path) == os.path.abspath(spec.uri[7:])
284+
if (
285+
os.path.abspath(spec.uri) == os.path.abspath(pkg.path)
286+
or (
287+
spec.uri.startswith("file://")
288+
and os.path.abspath(pkg.path) == os.path.abspath(spec.uri[7:])
289+
)
290+
or (
291+
spec.uri.startswith("symlink://")
292+
and os.path.abspath(pkg.path) == os.path.abspath(spec.uri[10:])
293+
)
287294
):
288295
return True
289296
if spec.uri != pkg.metadata.spec.uri:

0 commit comments

Comments
 (0)