Follow SemVer complaint version constraints when checking library updates // Resolve #1281

This commit is contained in:
Ivan Kravets
2020-09-02 20:36:56 +03:00
parent c8ea64edab
commit fe4112a2a3
2 changed files with 11 additions and 5 deletions

View File

@ -37,8 +37,9 @@ PlatformIO Core 5
* New **Package Management System**
- Integrated PlatformIO Core with the new PlatformIO Registry
- Strict dependency declaration using owner name (resolves name conflicts) (`issue #1824 <https://github.com/platformio/platformio-core/issues/1824>`_)
- Support for owner-based dependency declaration (resolves name conflicts) (`issue #1824 <https://github.com/platformio/platformio-core/issues/1824>`_)
- Automatically save dependencies to `"platformio.ini" <https://docs.platformio.org/page/projectconf.html>`__ when installing using PlatformIO CLI (`issue #2964 <https://github.com/platformio/platformio-core/issues/2964>`_)
- Follow SemVer complaint version constraints when checking library updates `issue #1281 <https://github.com/platformio/platformio-core/issues/1281>`_)
- Dropped support for "packageRepositories" section in "platform.json" manifest (please publish packages directly to the registry)
* **Build System**

View File

@ -254,8 +254,9 @@ def lib_update( # pylint: disable=too-many-arguments
for storage_dir in storage_dirs:
if not json_output:
print_storage_header(storage_dirs, storage_dir)
lib_deps = ctx.meta.get(CTX_META_STORAGE_LIBDEPS_KEY, {}).get(storage_dir, [])
lm = LibraryPackageManager(storage_dir)
_libraries = libraries or lm.get_installed()
_libraries = libraries or lib_deps or lm.get_installed()
if only_check and json_output:
result = []
@ -286,9 +287,13 @@ def lib_update( # pylint: disable=too-many-arguments
to_spec = (
None if isinstance(library, PackageItem) else PackageSpec(library)
)
lm.update(
library, to_spec=to_spec, only_check=only_check, silent=silent
)
try:
lm.update(
library, to_spec=to_spec, only_check=only_check, silent=silent
)
except UnknownPackageError as e:
if library not in lib_deps:
raise e
if json_output:
return click.echo(