Skip to content

Commit d36e394

Browse files
committed
Corrected the validation of symlink:// package specifications // Issue platformio#4870
1 parent c28740c commit d36e394

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
2323
* Introduced the ``--json-output`` option to the `pio test <https://docs.platformio.org/en/latest/core/userguide/cmd_test.html>`__ command, enabling users to generate test results in the JSON format
2424
* Broadened version support for the ``pyelftools`` dependency, enabling compatibility with lower versions and facilitating integration with a wider range of third-party tools (`issue #4834 <https://github.com/platformio/platformio-core/issues/4834>`_)
2525
* Addressed an issue where passing a relative path (``--project-dir``) to the `pio project init <https://docs.platformio.org/en/latest/core/userguide/project/cmd_init.html>`__ command resulted in an error (`issue #4847 <https://github.com/platformio/platformio-core/issues/4847>`_)
26+
* Corrected the validation of ``symlink://`` `package specifications <https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_install.html#local-folder>`__ , resolving an issue that caused the package manager to repeatedly reinstall dependencies (`pull #4870 <https://github.com/platformio/platformio-core/pull/4870>`_)
2627
* Resolved an issue related to the relative package path in the `pio pkg publish <https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_publish.html>`__ command
2728
* Resolved an issue where the |LDF| selected an incorrect library version (`issue #4860 <https://github.com/platformio/platformio-core/issues/4860>`_)
2829
* Resolved an issue with the ``hexlify`` filter in the `device monitor <https://docs.platformio.org/en/latest/core/userguide/device/cmd_monitor.html>`__ command, ensuring proper representation of characters with Unicode code points higher than 127 (`issue #4732 <https://github.com/platformio/platformio-core/issues/4732>`_)

platformio/package/manager/base.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -280,18 +280,15 @@ def test_pkg_spec(pkg, spec):
280280

281281
# external "URL" mismatch
282282
if spec.external:
283-
# local folder mismatch
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-
)
294-
):
283+
# local/symlinked folder mismatch
284+
check_conds = [
285+
os.path.abspath(spec.uri) == os.path.abspath(pkg.path),
286+
spec.uri.startswith("file://")
287+
and os.path.abspath(pkg.path) == os.path.abspath(spec.uri[7:]),
288+
spec.uri.startswith("symlink://")
289+
and os.path.abspath(pkg.path) == os.path.abspath(spec.uri[10:]),
290+
]
291+
if any(check_conds):
295292
return True
296293
if spec.uri != pkg.metadata.spec.uri:
297294
return False

0 commit comments

Comments
 (0)