From 0556b65aba729038cfde561b2bacfc7d693137df Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 28 Mar 2023 17:29:47 +0300 Subject: [PATCH] Updated for status --- slpkg/binaries/install.py | 11 +++-------- slpkg/sbos/slackbuild.py | 8 +++----- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/slpkg/binaries/install.py b/slpkg/binaries/install.py index adbb2d6e..61a39ea7 100644 --- a/slpkg/binaries/install.py +++ b/slpkg/binaries/install.py @@ -225,17 +225,12 @@ class Packages(Configs): repo_ver: str = BinQueries(package, self.repo).version() help_text: str = f'Package: {package}-{repo_ver}' + upgradable: str = self.utils.is_package_upgradeable(package) - if self.mode == 'build': + if self.mode == 'upgrade' and upgradable: status: bool = True - if self.mode == 'upgrade' and self.utils.is_package_upgradeable(package): - status: bool = True - - if self.mode == 'install' and not self.utils.is_package_installed(package): - status: bool = True - - if self.mode == 'install' and self.utils.is_package_upgradeable(package): + if self.mode == 'install' and upgradable: status: bool = True choices += [(package, repo_ver, status, help_text)] diff --git a/slpkg/sbos/slackbuild.py b/slpkg/sbos/slackbuild.py index 043b31c8..b943f0b6 100644 --- a/slpkg/sbos/slackbuild.py +++ b/slpkg/sbos/slackbuild.py @@ -361,17 +361,15 @@ class Slackbuilds(Configs): repo_ver: str = SBoQueries(package).version() description: str = SBoQueries(package).description() help_text: str = f'Description: {description}' + upgradable: str = self.utils.is_package_upgradeable(package) if self.mode == 'build': status: bool = True - if self.mode == 'upgrade' and self.utils.is_package_upgradeable(package): + if self.mode == 'upgrade' and upgradable: status: bool = True - if self.mode == 'install' and not self.utils.is_package_installed(package): - status: bool = True - - if self.mode == 'install' and self.utils.is_package_upgradeable(package): + if self.mode == 'install' and upgradable: status: bool = True choices += [(package, repo_ver, status, help_text)]