From 841a81b7d01dc5656b31a47f1e8394ff407ce8ab Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 22 Aug 2024 19:30:00 +0300 Subject: [PATCH] Fixed for upgrade Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 5 +++++ slpkg/upgrade.py | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 96d5924c..9074aa20 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,10 @@ ## slpkg - ChangeLog +### 5.1.2 - 22/08/2024 + +- Fixed: + * Fixed for upgrade when new_packages method is enabled + ### 5.1.1 - 22/07/2024 - Added: diff --git a/slpkg/upgrade.py b/slpkg/upgrade.py index 93920290..0dafc0b7 100644 --- a/slpkg/upgrade.py +++ b/slpkg/upgrade.py @@ -32,7 +32,6 @@ class Upgrade(Configs): # pylint: disable=[R0902] self.sum_upgrade: int = 0 self.sum_removed: int = 0 self.sum_added: int = 0 - self.installed_names: list = [] self.installed_packages: list = [] self.kernel_ver: str = platform.uname()[2] @@ -64,10 +63,8 @@ class Upgrade(Configs): # pylint: disable=[R0902] extra_package: str = extra_repo[name]['package'] if extra_package[:-4] != package: self.installed_packages.append(Path(package)) - self.installed_names.append(name) else: self.installed_packages.append(Path(package)) - self.installed_names.append(name) else: repo_tag: str = self.repos.repositories[repository]['repo_tag'] self.installed_packages: list = list(self.log_packages.glob(f'*{repo_tag}')) @@ -92,7 +89,6 @@ class Upgrade(Configs): # pylint: disable=[R0902] if self.repository in self.repos.new_packages: for name in self.data.keys(): if not self.utils.is_package_installed(name): - # if name not in self.installed_names: yield name def is_package_upgradeable(self, installed: str) -> bool: # pylint: disable=[R0911] @@ -220,8 +216,7 @@ class Upgrade(Configs): # pylint: disable=[R0902] if repo in self.repos.new_packages: for name in data.keys(): - # if not self.utils.is_package_installed(name): - if name not in self.installed_names: + if not self.utils.is_package_installed(name): self.id += 1 self.sum_added += 1 repo_version: str = data[name]['version']