There could potentially be a huge amount of modules and firmware
which makes these log messages very noisy. Let's drop them to make
debug logs less annoying to parse.
for m in modules:
rel = os.fspath(Path(*m.parts[1:]))
if regex.search(rel):
- logging.debug(f"Including module {rel}")
keep.add(rel)
if exclude:
for m in modules:
rel = os.fspath(Path(*m.parts[1:]))
if rel not in keep and regex.search(rel):
- logging.debug(f"Excluding module {rel}")
remove.add(m)
modules -= remove
p = root / m
if p.is_file() or p.is_symlink():
- logging.debug(f"Removing module {m}")
p.unlink()
else:
p.rmdir()
p = root / fw
if p.is_file() or p.is_symlink():
- logging.debug(f"Removing firmware {fw}")
p.unlink()
else:
p.rmdir()