diff --git a/HISTORY.rst b/HISTORY.rst index 286890f9..fe9e137f 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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 `_) + - Support for owner-based dependency declaration (resolves name conflicts) (`issue #1824 `_) - Automatically save dependencies to `"platformio.ini" `__ when installing using PlatformIO CLI (`issue #2964 `_) + - Follow SemVer complaint version constraints when checking library updates `issue #1281 `_) - Dropped support for "packageRepositories" section in "platform.json" manifest (please publish packages directly to the registry) * **Build System** diff --git a/platformio/commands/lib/command.py b/platformio/commands/lib/command.py index 23a5b46e..543e439c 100644 --- a/platformio/commands/lib/command.py +++ b/platformio/commands/lib/command.py @@ -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(