Updated for options check

This commit is contained in:
Dimitris Zlatanidis 2023-04-08 22:51:10 +03:00
parent 8865d0a58b
commit 5bb3d19072

View file

@ -24,12 +24,12 @@ class Upgrade(Configs):
self.utils = Utilities()
self.repos = Repositories()
self.repo_for_binaries: bool = self.utils.is_option(['-B', '--bin-repo='], self.flags)
self.bin_repo_dict: dict = {}
self.sbo_repo_dict: dict = {}
self.flag_bin_repository: list = ['-B', '--bin-repo=']
self.repo_for_binaries: bool = self.utils.is_option(self.flag_bin_repository, self.flags)
if self.utils.is_option(self.flag_bin_repository, self.flags):
if self.repo_for_binaries:
self.bin_repo_dict: dict = BinQueries(self.repo).repository_data()
else:
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
@ -41,7 +41,7 @@ class Upgrade(Configs):
def packages(self) -> Generator[str, None, None]:
""" Returns the upgradable packages. """
if self.utils.is_option(self.flag_bin_repository, self.flags):
if self.repo_for_binaries:
repo_packages: list = list(self.bin_repo_dict.keys())
else:
repo_packages: list = list(self.sbo_repo_dict.keys())