Fixed for repos dict

This commit is contained in:
Dimitris Zlatanidis 2023-04-08 21:33:30 +03:00
parent a712392436
commit 5b90b8834a

View file

@ -29,6 +29,11 @@ class Upgrade(Configs):
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):
self.bin_repo_dict: dict = BinQueries(self.repo).repository_data()
else:
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
logging.basicConfig(filename=str(LoggingConfig.log_file),
filemode='w',
encoding='utf-8',
@ -37,10 +42,8 @@ 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):
self.bin_repo_dict: dict = BinQueries(self.repo).repository_data()
repo_packages: list = list(self.bin_repo_dict.keys())
else:
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
repo_packages: list = list(self.sbo_repo_dict.keys())
# Returns the matched packages between two lists.