Fixed for check tables

This commit is contained in:
Dimitris Zlatanidis 2023-04-24 13:31:46 +03:00
parent 1f0c934e96
commit f845216457
3 changed files with 19 additions and 13 deletions

View file

@ -1,10 +1,10 @@
4.8.1 - 21/04/2023
Updated:
- For error messages
- For repository updates (Thanks to rizitis)
Fixed:
- Double packages as main and as dependency for binaries repos
- View packages for ponce repository (Thanks to rizitis)
- For repository updates (Thanks to rizitis)
4.8.0 - 19/04/2023
Fixed:

View file

@ -77,10 +77,16 @@ class Check(Configs):
if not_found:
self.errors.raise_error_message(f'Not found \'{", ".join(not_found)}\' installed packages')
def is_empty_database(self) -> None:
def is_empty_database(self, repo) -> None:
""" Checking for empty table and database file. """
db = Path(self.db_path, self.database_name)
if not self.session.query(self.repo_table).first() or not db.is_file():
if self.option_for_binaries:
count = self.session.query(self.repo_table.id).where(self.repo_table.repo == repo).count()
else:
count = self.session.query(self.repo_table.id).count()
if not self.session.query(self.repo_table).first() or not db.is_file() or count == 0:
self.errors.raise_error_message("You need to update the package lists first, run:\n\n"
" $ 'slpkg update'\n"
" $ 'slpkg update --bin-repo='*' for binaries")

View file

@ -524,7 +524,7 @@ class Argparse(Configs):
command = Argparse.upgrade.__name__
if len(self.args) == 1:
self.check.is_empty_database()
self.check.is_empty_database(self.binary_repo)
upgrade = Upgrade(self.flags, self.data)
packages: list = list(upgrade.packages())
@ -566,7 +566,7 @@ class Argparse(Configs):
def clean_logs(self) -> None:
if len(self.args) == 1:
self.check.is_empty_database()
self.check.is_empty_database(self.binary_repo)
logs = CleanLogsDependencies(self.flags)
logs.clean()
@ -602,7 +602,7 @@ class Argparse(Configs):
if len(self.args) >= 2:
self.check.is_empty_database()
self.check.is_empty_database(self.binary_repo)
packages: list = self.is_file_list_packages()
if self.utils.is_option(self.flag_searches, self.flags):
@ -621,7 +621,7 @@ class Argparse(Configs):
if len(self.args) >= 2:
self.check.is_empty_database()
self.check.is_empty_database(self.binary_repo)
packages: list = self.is_file_list_packages()
if self.utils.is_option(self.flag_searches, self.flags):
@ -646,7 +646,7 @@ class Argparse(Configs):
if len(self.args) >= 2:
self.check.is_empty_database()
self.check.is_empty_database(self.binary_repo)
packages: list = self.is_file_list_packages()
if self.utils.is_option(self.flag_searches, self.flags):
@ -680,7 +680,7 @@ class Argparse(Configs):
if len(self.args) >= 2:
self.check.is_empty_database()
self.check.is_empty_database(self.binary_repo)
packages: list = self.is_file_list_packages()
if self.utils.is_option(self.flag_searches, self.flags):
@ -696,7 +696,7 @@ class Argparse(Configs):
if len(self.args) >= 2:
self.check.is_empty_database()
self.check.is_empty_database(self.binary_repo)
packages: list = self.is_file_list_packages()
if self.utils.is_option(self.flag_searches, self.flags):
@ -718,7 +718,7 @@ class Argparse(Configs):
if len(self.args) >= 2:
self.check.is_empty_database()
self.check.is_empty_database(self.binary_repo)
packages: list = self.is_file_list_packages()
if self.utils.is_option(self.flag_searches, self.flags):
@ -734,7 +734,7 @@ class Argparse(Configs):
if len(self.args) >= 2:
self.check.is_empty_database()
self.check.is_empty_database(self.binary_repo)
packages: list = self.is_file_list_packages()
if self.utils.is_option(self.flag_searches, self.flags):
@ -752,7 +752,7 @@ class Argparse(Configs):
if len(self.args) >= 2:
self.check.is_empty_database()
self.check.is_empty_database(self.binary_repo)
packages: list = self.is_file_list_packages()
if self.utils.is_option(self.flag_searches, self.flags):