Fixed for installing

This commit is contained in:
Dimitris Zlatanidis 2023-04-02 20:37:49 +03:00
parent e2eca62151
commit 5d4d961e7d

View file

@ -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)