From 5d4d961e7d52f1175294ae8743aeeb9f06f4991f Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 2 Apr 2023 20:37:49 +0300 Subject: [PATCH] Fixed for installing --- slpkg/binaries/install.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/slpkg/binaries/install.py b/slpkg/binaries/install.py index fbd232f2..01060511 100644 --- a/slpkg/binaries/install.py +++ b/slpkg/binaries/install.py @@ -82,6 +82,12 @@ class Packages(Configs): if not self.utils.is_option(self.flag_resolve_off, self.flags): for pkg in self.packages: + + # Skip installed package when the option --skip-installed is applied. + if (self.utils.is_option(self.flag_skip_installed, self.flags) and + self.utils.is_package_installed(pkg)): + continue + self.packages_requires += Required(pkg, self.repo).resolve() # Clean dependencies from the dependencies list if already added with main packages. @@ -124,12 +130,18 @@ class Packages(Configs): and continue to install if the package is upgradable or the --reinstall option applied. """ - if self.utils.is_option(self.flag_skip_installed, self.flags): + if (self.utils.is_option(self.flag_skip_installed, self.flags) + and not self.utils.is_option(self.flag_reinstall, self.flags)): return False - if self.upgrade.is_package_upgradeable(name) or self.utils.is_option(self.flag_reinstall, self.flags): + if self.utils.is_option(self.flag_reinstall, self.flags): return True + if not self.upgrade.is_package_upgradeable(name): + return False + + return True + def checksum(self) -> None: """ Packages checksums. """ md5 = Md5sum(self.flags)