Fixed for check update

This commit is contained in:
Dimitris Zlatanidis 2023-03-28 22:25:58 +03:00
parent cc569bddc8
commit ce322618c7
3 changed files with 9 additions and 8 deletions

View file

@ -15,9 +15,10 @@ from slpkg.repositories import Repositories
class CheckUpdates(Configs):
""" Check for changes in the ChangeLog file. """
def __init__(self, flags: list):
def __init__(self, flags: list, repo: str):
super(Configs, self).__init__()
self.flags: list = flags
self.repo = repo
self.utils = Utilities()
self.progress = ProgressBar()
self.color = self.colour()
@ -39,22 +40,22 @@ class CheckUpdates(Configs):
compare: dict = {}
if self.utils.is_option(self.flag_bin_repository, self.flags):
if self.repos.alien_repo:
if self.repos.alien_repo and self.repo == self.repos.alien_repo_name or self.repo == '*':
self.local_chg_txt: Path = Path(self.repos.alien_repo_path, self.repos.alien_repo_changelog)
self.repo_chg_txt: str = f'{self.repos.alien_repo_changelog_mirror}{self.repos.alien_repo_changelog}'
compare[self.repos.alien_repo_name] = self.compare_dates()
if self.repos.gnome_repo:
if self.repos.gnome_repo and self.repo == self.repos.gnome_repo_name or self.repo == '*':
self.local_chg_txt: Path = Path(self.repos.gnome_repo_path, self.repos.gnome_repo_changelog)
self.repo_chg_txt: str = f'{self.repos.gnome_repo_mirror}{self.repos.gnome_repo_changelog}'
compare[self.repos.gnome_repo_name] = self.compare_dates()
if self.repos.conraid_repo:
if self.repos.conraid_repo and self.repo == self.repos.conraid_repo_name or self.repo == '*':
self.local_chg_txt: Path = Path(self.repos.conraid_repo_path, self.repos.conraid_repo_changelog)
self.repo_chg_txt: str = f'{self.repos.conraid_repo_mirror}{self.repos.conraid_repo_changelog}'
compare[self.repos.conraid_repo_name] = self.compare_dates()
if self.repos.slackonly_repo:
if self.repos.slackonly_repo and self.repo == self.repos.slackonly_repo_name or self.repo == '*':
self.local_chg_txt: Path = Path(self.repos.slackonly_repo_path, self.repos.slackonly_repo_changelog)
self.repo_chg_txt: str = f'{self.repos.slackonly_repo_mirror}{self.repos.slackonly_repo_changelog}'
compare[self.repos.slackonly_repo_name] = self.compare_dates()
@ -96,7 +97,7 @@ class CheckUpdates(Configs):
f"'{self.bgreen}{repo}{self.endc}'{self.green} repository!{self.endc}")
if True not in compare.values():
print(f'\n{self.endc}{self.yellow}No updated packages since the last check.{self.endc}')
print(f'{self.endc}{self.yellow}No updated packages since the last check.{self.endc}')
def updates(self) -> None:
""" Starting multiprocessing download process. """

View file

@ -520,7 +520,7 @@ class Argparse(Configs):
def check_updates(self) -> None:
if len(self.args) == 1:
check = CheckUpdates(self.flags)
check = CheckUpdates(self.flags, self.binary_repo)
check.updates()
raise SystemExit()
self.usage.help_short(1)

View file

@ -220,7 +220,7 @@ class UpdateRepository(Configs):
os.makedirs(path)
def check(self, queue) -> None:
check_updates = CheckUpdates(self.flags)
check_updates = CheckUpdates(self.flags, self.bin_repo)
compare = check_updates.check()
is_update: dict = {}