Skip to content

Commit

Permalink
Fix symlink package spec validation (#4870)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
willmmiles authored Mar 16, 2024
1 parent c0d9728 commit 430acc8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions platformio/package/manager/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,16 @@ def test_pkg_spec(pkg, spec):
# 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:
Expand Down

0 comments on commit 430acc8

Please sign in to comment.