Updated for blacklist

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2022-11-23 17:05:30 +02:00
parent 0acbf687b5
commit d5bca75e53
2 changed files with 8 additions and 13 deletions

View file

@ -49,14 +49,17 @@ class Check:
raise SystemExit('\nNot found installed packages.\n')
def blacklist(self, slackbuilds: list):
''' Checking for packages on the blacklist and removing them. '''
''' Checking if the packages are blacklisted. '''
packages = []
black = Blacklist()
for package in black.get():
if package in slackbuilds:
slackbuilds.remove(package)
packages.append(package)
return slackbuilds
if packages:
raise SystemExit(
f'\nThe package \'{", ".join(packages)}\' is blacklisted.\n')
def database(self):
''' Checking for empty table '''

View file

@ -33,6 +33,8 @@ class Argparse:
if len(self.args) == 0:
usage(1)
self.check.blacklist(self.args)
def flag(self):
self.flags = []
@ -140,9 +142,6 @@ class Argparse:
packages = list(set(self.args[1:]))
self.check.database()
packages = self.check.blacklist(packages)
self.check.installed(packages)
remove = RemovePackages(packages, self.flags)
@ -155,9 +154,6 @@ class Argparse:
packages = list(set(self.args[1:]))
self.check.database()
packages = self.check.blacklist(packages)
self.check.exists(packages)
view = ViewPackage()
@ -171,8 +167,6 @@ class Argparse:
self.check.database()
packages = self.check.blacklist(packages)
search = SearchPackage()
search.package(packages)
raise SystemExit()
@ -184,8 +178,6 @@ class Argparse:
self.check.database()
packages = self.check.blacklist(packages)
find = FindInstalled()
find.find(packages)
raise SystemExit()