From a97a42991883674c8f46d67ca4225c6c4771adce Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Fri, 5 May 2023 22:21:00 +0300 Subject: [PATCH] Updated for update command --- slpkg/check_updates.py | 31 ++++++++++++++++--------------- slpkg/repositories.py | 1 + slpkg/update_repository.py | 4 ++++ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/slpkg/check_updates.py b/slpkg/check_updates.py index a9d0a191..eb509d97 100644 --- a/slpkg/check_updates.py +++ b/slpkg/check_updates.py @@ -39,28 +39,29 @@ class CheckUpdates(Configs): level=LoggingConfig.level) def check(self) -> dict: - sbo_repository: dict = { - self.repos.sbo_repo_name: self.sbo_repository, - self.repos.ponce_repo_name: self.ponce_repository - } - if self.option_for_repository: + + sbo_repository: dict = { + self.repos.sbo_repo_name: self.sbo_repository, + self.repos.ponce_repo_name: self.ponce_repository + } + if self.is_binary: self.binary_repository(self.repository) else: sbo_repository[self.repository]() - return self.compare - - for repo in list(self.repos.repositories.keys())[2:]: - - if self.repos.repositories[repo][0]: - self.binary_repository(repo) - - if self.repos.ponce_repo: - self.ponce_repository() else: - self.sbo_repository() + if self.repos.sbo_repo: + self.sbo_repository() + + if self.repos.ponce_repo: + self.ponce_repository() + + for repo in list(self.repos.repositories.keys())[2:]: + + if self.repos.repositories[repo][0]: + self.binary_repository(repo) return self.compare diff --git a/slpkg/repositories.py b/slpkg/repositories.py index f8eaeaf7..208e2309 100644 --- a/slpkg/repositories.py +++ b/slpkg/repositories.py @@ -211,6 +211,7 @@ class Repositories: default_repository: str = repos_config['DEFAULT_REPOSITORY'] + sbo_repo: str = repos_config['SBO_REPO'] sbo_repo_name: str = repos_config['SBO_REPO_NAME'] sbo_repo_local = repos_config['SBO_REPO_LOCAL'] sbo_repo_mirror = repos_config['SBO_REPO_MIRROR'] diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index 009768df..351c02e3 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -50,6 +50,10 @@ class UpdateRepository(Configs): def update_the_repositories(self) -> None: if not any(list(self.repos_for_update.values())): self.view.question() + for repo in self.repos_for_update: + self.repos_for_update[repo] = True + + raise SystemExit(self.repos_for_update) else: print()