Check for empty database

This commit is contained in:
Dimitris Zlatanidis 2022-06-17 22:27:09 +03:00
parent d3c64af608
commit 7eeecaf841

View file

@ -23,6 +23,7 @@ class Check:
def exists(self):
''' Checking if the slackbuild exists in the repository. '''
self.database()
for sbo in self.slackbuilds:
if not SBoQueries(sbo).slackbuild():
raise SystemExit(f'Error: Package {sbo} does not exists.')
@ -43,6 +44,12 @@ class Check:
return
raise SystemExit('Error: Not found packages for remove.')
def database(self):
''' Checking for empty table '''
if not SBoQueries('').names():
raise SystemExit('\nYou need to update the package lists first.\n'
'Please run slpkg update.\n')
@dataclass
class Argparse: