Fixed for update

This commit is contained in:
Dimitris Zlatanidis 2023-03-28 22:15:09 +03:00
parent 01bde5c2ba
commit cc569bddc8
3 changed files with 13 additions and 13 deletions

View file

@ -153,7 +153,7 @@ class Packages(Configs):
if exist:
self.session.query(
LogsDependencies).filter(
LogsDependencies.name == name).update(
LogsDependencies.name == name).repos_for_update(
{LogsDependencies.requires: ' '.join(requires)})
elif requires:

View file

@ -240,7 +240,7 @@ class Slackbuilds(Configs):
if exist:
self.session.query(
LogsDependencies).filter(
LogsDependencies.name == name).update(
LogsDependencies.name == name).repos_for_update(
{LogsDependencies.requires: ' '.join(requires)})
elif requires:

View file

@ -21,10 +21,10 @@ from slpkg.models.models import (Base, engine, SBoTable,
class UpdateRepository(Configs):
""" Deletes and install the data. """
def __init__(self, flags: list, repository: str):
def __init__(self, flags: list, repo: str):
super(Configs, self).__init__()
self.flags: list = flags
self.repository: str = repository
self.bin_repo: str = repo
self.session = Session
self.view = ViewMessage(self.flags)
@ -34,7 +34,7 @@ class UpdateRepository(Configs):
self.color = self.colour()
self.data = InstallData()
self.update: int = 0
self.repos_for_update: dict = {}
self.bold: str = self.color['bold']
self.green: str = self.color['green']
self.red: str = self.color['red']
@ -47,22 +47,22 @@ class UpdateRepository(Configs):
def update_the_repositories(self) -> None:
""" Updated the sbo repository. """
if self.update == 0:
if not self.repos_for_update.values() or self.bin_repo not in self.repos_for_update.keys():
self.view.question()
else:
print()
if self.utils.is_option(self.flag_bin_repository, self.flags):
if self.repository == self.repos.alien_repo_name or self.repository == '*':
if self.bin_repo == self.repos.alien_repo_name or self.bin_repo == '*':
self.alien_repository()
if self.repository == self.repos.gnome_repo_name or self.repository == '*':
if self.bin_repo == self.repos.gnome_repo_name or self.bin_repo == '*':
self.gnome_repository()
if self.repository == self.repos.conraid_repo_name or self.repository == '*':
if self.bin_repo == self.repos.conraid_repo_name or self.bin_repo == '*':
self.conraid_repository()
if self.repository == self.repos.slackonly_repo_name or self.repository == '*':
if self.bin_repo == self.repos.slackonly_repo_name or self.bin_repo == '*':
self.slackonly_repository()
else:
self.slackbuild_repositories()
@ -222,13 +222,13 @@ class UpdateRepository(Configs):
def check(self, queue) -> None:
check_updates = CheckUpdates(self.flags)
compare = check_updates.check()
is_update: int = 0
is_update: dict = {}
for repo, comp in compare.items():
if comp:
print(f"\n\n{self.green}There are new updates available for the{self.endc} "
f"'{self.bgreen}{repo}{self.endc}'{self.green} repository!{self.endc}")
is_update: int = 1
is_update[repo] = comp
if True not in compare.values():
print(f'\n\n{self.endc}{self.yellow}No changes in ChangeLog.txt between your '
@ -261,7 +261,7 @@ class UpdateRepository(Configs):
# Restore the terminal cursor
print('\x1b[?25h', self.endc, end='')
self.update = queue.get()
self.repos_for_update = queue.get()
self.update_the_repositories()
def delete_sbo_data(self) -> None: