From a5b7a547db1fcf4c82c13a2af53160f06448d4ea Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 28 Mar 2023 17:18:57 +0300 Subject: [PATCH] Updated for resolve off --- slpkg/binaries/install.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/slpkg/binaries/install.py b/slpkg/binaries/install.py index c4231269..adbb2d6e 100644 --- a/slpkg/binaries/install.py +++ b/slpkg/binaries/install.py @@ -77,24 +77,28 @@ class Packages(Configs): def dependencies(self): """ Creating te dependencies list and the order for install. """ requires: list = [] - for pkg in self.packages: - self.packages_requires += Required(pkg, self.repo).resolve() - # Clean dependencies from the dependencies list if already added with main packages. - for req in self.packages_requires: - if req not in self.packages and req in self.repo_package_names: - requires.append(req) + if not self.utils.is_option(self.flag_resolve_off, self.flags): - requires = list(set(requires)) + for pkg in self.packages: + self.packages_requires += Required(pkg, self.repo).resolve() - if requires: - self.packages_requires = self.choose_dependencies(requires) + # Clean dependencies from the dependencies list if already added with main packages. + for req in self.packages_requires: + if req not in self.packages and req in self.repo_package_names: + requires.append(req) + + requires = list(set(requires)) + + if requires: + self.packages_requires = self.choose_dependencies(requires) self.install_order = [*self.packages_requires, *self.packages] def download(self) -> None: """ Download packages from the repositories. """ pkg_urls: list = [] + for pkg in self.install_order: if not self.skip_installed_package(pkg): @@ -137,8 +141,9 @@ class Packages(Configs): self.multi_process(command, package, message) - name: str = self.utils.split_binary_pkg(package[:-4])[0] - self.logging_installed_dependencies(name) + if not self.utils.is_option(self.flag_resolve_off, self.flags): + name: str = self.utils.split_binary_pkg(package[:-4])[0] + self.logging_installed_dependencies(name) def logging_installed_dependencies(self, name: str) -> None: """ Logging installed dependencies and used for remove. """