Updated for blacklist

This commit is contained in:
Dimitris Zlatanidis 2023-04-09 12:37:53 +03:00
parent 27d9009b44
commit 11d01cebb8
2 changed files with 10 additions and 2 deletions

View file

@ -1,6 +1,7 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from slpkg.blacklist import Blacklist
from slpkg.repositories import Repositories
@ -14,6 +15,7 @@ class Required:
self.name: str = name
self.repo: str = repo
self.repos = Repositories()
self.black = Blacklist()
self.special_repos: list = [
self.repos.salixos_repo_name,
@ -38,8 +40,9 @@ class Required:
# Remove requirements that are included as dependencies,
# but are not included in the repository.
if req not in list(self.data.keys()):
if req not in list(self.data.keys()) or req in self.black.packages():
required.remove(req)
continue
if req:
try:

View file

@ -1,6 +1,8 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from slpkg.blacklist import Blacklist
class Requires:
""" Creates a list of dependencies with
@ -11,6 +13,8 @@ class Requires:
self.data: dict = data
self.name: str = name
self.black = Blacklist()
def resolve(self) -> list:
""" Resolve the dependencies. """
requires: list[str] = self.data[self.name][7].split()
@ -19,8 +23,9 @@ class Requires:
# Remove requirements that are included as dependencies,
# but are not included in the repository.
if req not in list(self.data.keys()):
if req not in list(self.data.keys()) or req in self.black.packages():
requires.remove(req)
continue
if req:
sub_requires: list[str] = self.data[req][7].split()