feat(commit): individual packages from config respected

This commit is contained in:
2026-05-07 18:25:19 +02:00
parent b7218c2a82
commit ecb2952a7e
9 changed files with 69 additions and 16 deletions
+18 -6
View File
@@ -12,11 +12,23 @@ def pkg_diff(target: List[str], actual: List[str]) -> tuple[List[str], List[str]
A tuple with first the missing (not installed) packages
and second the extraneous (to be uninstalled) packages
"""
for i, pkg in enumerate(actual):
removed = []
diffed_out = []
for pkg in actual:
try:
idx = target.index(pkg)
target.pop(idx)
actual.pop(i)
diffed_out.append(target.index(pkg))
except Exception:
pass
return (target, actual)
removed.append(pkg)
diffed_out.reverse()
new_pkgs = []
if len(diffed_out) > 0:
curr = diffed_out.pop()
for i, pkg in enumerate(target):
if i != curr:
new_pkgs.append(pkg)
else:
if len(diffed_out) > 0:
curr = diffed_out.pop()
return (new_pkgs, removed)