mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Check for empty database
This commit is contained in:
parent
d3c64af608
commit
7eeecaf841
1 changed files with 7 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue