From 400a92f7c8573a2861ee1e5ae377938a99f04467 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 30 Mar 2024 20:56:01 +0200 Subject: [PATCH] Bugfixes for check custom packages --- ChangeLog.txt | 5 ++++- slpkg/upgrade.py | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 79689326..24386231 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,9 +1,12 @@ ## slpkg - ChangeLog -### 5.0.2 - 29/03/2024 +### 5.0.2 - 30/03/2024 - Updated: * Updated for coding style +- Bugfixes: + * Check for custom upgrade packages (Thanks to Marav) + ### 5.0.1 - 29/03/2024 - Updated: * Updated to check upgrade packages against all repositories (slpkg upgrade --repository='*' --check) diff --git a/slpkg/upgrade.py b/slpkg/upgrade.py index 208e6d60..db0732b0 100644 --- a/slpkg/upgrade.py +++ b/slpkg/upgrade.py @@ -27,8 +27,8 @@ class Upgrade(Configs): self.installed_names: list = [] self.installed_packages: list = [] - def load_installed_packages(self): - if self.repository in [self.repos.slack_repo_name, self.repos.salixos_repo_name]: + def load_installed_packages(self, repository: str) -> None: + if repository in [self.repos.slack_repo_name, self.repos.salixos_repo_name]: installed: dict = self.utils.all_installed() for name, package in installed.items(): @@ -37,12 +37,12 @@ class Upgrade(Configs): self.installed_packages.append(Path(package)) self.installed_names.append(name) else: - repo_tag: str = self.repos.repositories[self.repository]['repo_tag'] + repo_tag: str = self.repos.repositories[repository]['repo_tag'] self.installed_packages: list = list(self.log_packages.glob(f'*{repo_tag}')) def packages(self) -> Generator: """ Returns the upgradable packages. """ - self.load_installed_packages() + self.load_installed_packages(self.repository) for inst in self.installed_packages: name: str = self.utils.split_package(inst.name)['name'] @@ -82,12 +82,12 @@ class Upgrade(Configs): if self.repository == '*': repo_data: dict = self.data - self.installed_packages: list = list(self.log_packages.glob('*')) else: - self.load_installed_packages() repo_data[self.repository] = self.data for repo, data in repo_data.items(): + self.load_installed_packages(repo) + for installed in self.installed_packages: name: str = self.utils.split_package(installed.name)['name']