Skip to content

Commit

Permalink
pio: uninstall one package at a time
Browse files Browse the repository at this point in the history
amend 7c2130b
since install skips deps, skip them in uninstall as well
  • Loading branch information
mcspr committed Jan 14, 2025
1 parent 4d8b765 commit 05513b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/scripts/pio_pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def install_libraries(specs, storage, verbose=False):
lm = LibraryPackageManager(storage)
lm.set_log_level(logging.DEBUG if verbose else logging.INFO)

# as described in platformio .ini
known = set()

for spec in specs:
pkg = lm.get_package(spec)
if not pkg:
Expand All @@ -95,10 +97,12 @@ def install_libraries(specs, storage, verbose=False):

lm.memcache_reset()

# actually installed packages (library storage)
installed = set(lm.get_installed())

for pkg in installed.difference(known):
try:
lm.uninstall(pkg)
lm.uninstall(pkg, skip_dependencies=True)
except:
pass

Expand Down

0 comments on commit 05513b5

Please sign in to comment.