Fix platformio_install_deps no longer installing all lib_deps (#2584)

This commit is contained in:
Otto Winter 2021-10-21 15:29:32 +02:00 committed by Otto winter
parent f0aba6ceb2
commit 7d9d9fcf36
No known key found for this signature in database
GPG Key ID: 48ED2DDB96D7682C

View File

@ -8,6 +8,23 @@ import sys
config = configparser.ConfigParser(inline_comment_prefixes=(';', ))
config.read(sys.argv[1])
libs = [x for x in config['common']['lib_deps'].splitlines() if len(x) != 0]
libs = []
# Extract from every lib_deps key in all sections
for section in config.sections():
conf = config[section]
if "lib_deps" not in conf:
continue
for lib_dep in conf["lib_deps"].splitlines():
if not lib_dep:
# Empty line or comment
continue
if lib_dep.startswith("${"):
# Extending from another section
continue
if "@" not in lib_dep:
# No version pinned, this is an internal lib
continue
libs.append(lib_dep)
subprocess.check_call(['platformio', 'lib', '-g', 'install', *libs])