diff --git a/slpkg/remove_packages.py b/slpkg/remove_packages.py index 4898e5d3..83539222 100644 --- a/slpkg/remove_packages.py +++ b/slpkg/remove_packages.py @@ -7,6 +7,7 @@ import subprocess from slpkg.metadata import Metadata from dataclasses import dataclass +from slpkg.blacklist import Blacklist from slpkg.views.views import ViewMessage from slpkg.models.models import LogsDependencies from slpkg.models.models import session as Session @@ -18,6 +19,7 @@ class RemovePackages: packages: str flags: list session: str = Session + black: list = Blacklist() log_packages: str = Metadata.log_packages repo_tag: str = Metadata.repo_tag removepkg: str = Metadata.removepkg @@ -73,7 +75,10 @@ class RemovePackages: ''' View and creates list with packages for remove. ''' installed = os.listdir(self.log_packages) color = self.color() + for package in installed: - if package.startswith(name) and self.repo_tag in package: + black = package.split('-')[0] + if (package.startswith(name) and self.repo_tag in package and + black not in self.black.get()): self.installed_packages.append(package) print(f'[{color["RED"]} delete {color["ENDC"]}] -> {package}')