Fixed for doubles dependencies

This commit is contained in:
Dimitris Zlatanidis 2023-04-09 17:23:15 +03:00
parent ba7755e76c
commit baabd3daab

View file

@ -4,6 +4,7 @@
import os
import time
import subprocess
from collections import OrderedDict
from multiprocessing import Process
from slpkg.configs import Configs
@ -78,8 +79,6 @@ class Packages(Configs):
def dependencies(self):
""" Creating the dependencies list and the order for install. """
requires: list = []
if not self.utils.is_option(self.flag_resolve_off, self.flags):
for pkg in self.packages:
@ -92,11 +91,7 @@ class Packages(Configs):
self.packages_requires += Required(self.data, 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:
requires.append(req)
requires = list(set(requires))
requires = list(OrderedDict.fromkeys(self.packages_requires))
if requires:
self.packages_requires = self.choose_dependencies(requires)