Resovle symlink based on the saved cwd

This commit is contained in:
Ivan Kravets
2022-04-05 09:07:44 +03:00
parent e2f21212b7
commit fb2f3c8836
2 changed files with 9 additions and 8 deletions

View File

@ -24,10 +24,13 @@ PlatformIO Core 5
* `pio pkg uninstall <https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_uninstall.html>`_ - uninstall the project dependencies or custom packages
* `pio pkg update <https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_update.html>`__ - update the project dependencies or custom packages
- Package Manifest
* Added support for `"scripts" <https://docs.platformio.org/en/latest/librarymanager/config.html#scripts>`__ (`issue #485 <https://github.com/platformio/platformio-core/issues/485>`_)
* Added support for `multi-licensed <https://docs.platformio.org/en/latest/librarymanager/config.html#license>`__ packages using SPDX Expressions (`issue #4037 <https://github.com/platformio/platformio-core/issues/4037>`_)
* Added support for `"dependencies" <https://docs.platformio.org/en/latest/librarymanager/config.html#dependencies>`__ declared in a "tool" package manifest
- Added support for `symbolic links <https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_install.html#local-folder>`__ allowing pointing the local source folder to the Package Manager (`issue #3348 <https://github.com/platformio/platformio-core/issues/3348>`_)
- Added support for `"scripts" <https://docs.platformio.org/en/latest/librarymanager/config.html#scripts>`__ in package manifest (`issue #485 <https://github.com/platformio/platformio-core/issues/485>`_)
- Added support for `multi-licensed <https://docs.platformio.org/en/latest/librarymanager/config.html#license>`__ packages using SPDX Expressions (`issue #4037 <https://github.com/platformio/platformio-core/issues/4037>`_)
- Added support for `"dependencies" <https://docs.platformio.org/en/latest/librarymanager/config.html#dependencies>`__ declared in a "tool" package manifest
- Automatically install dependencies of the local (private) project libraries (`issue #2910 <https://github.com/platformio/platformio-core/issues/2910>`_)
- Ignore files according to the patterns declared in ".gitignore" when using the `pio package pack <https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_pack.html>`__ command (`issue #4188 <https://github.com/platformio/platformio-core/issues/4188>`_)
- Dropped automatic updates of global libraries and development platforms (`issue #4179 <https://github.com/platformio/platformio-core/issues/4179>`_)

View File

@ -33,11 +33,9 @@ class PackageManagerSymlinkMixin(object):
data = json.load(fp)
spec = PackageSpec(**data["spec"])
assert spec.symlink
pkg_dir = os.path.realpath(spec.uri[10:])
if not os.path.isdir(pkg_dir):
with fs.cd(data["cwd"]):
pkg_dir = os.path.realpath(pkg_dir)
return (pkg_dir if os.path.isdir(pkg_dir) else None, spec)
with fs.cd(data["cwd"]):
pkg_dir = os.path.realpath(pkg_dir)
return (pkg_dir if os.path.isdir(pkg_dir) else None, spec)
def get_symlinked_package(self, path):
pkg_dir, spec = self.resolve_symlink(path)