mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Fixed resolving for special repos
This commit is contained in:
parent
1d70f7a94a
commit
f880c287ce
1 changed files with 24 additions and 1 deletions
|
@ -1,6 +1,9 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from slpkg.repositories import Repositories
|
||||
|
||||
|
||||
class Required:
|
||||
""" Creates a list of dependencies with
|
||||
the right order to install. """
|
||||
|
@ -9,18 +12,38 @@ class Required:
|
|||
__slots__ = 'data', 'name,'
|
||||
self.data: dict = data
|
||||
self.name: str = name
|
||||
self.repos = Repositories()
|
||||
|
||||
self.special_repos: list = [
|
||||
self.repos.salixos_repo_name,
|
||||
self.repos.salixos_patches_repo_name,
|
||||
self.repos.salixos_extra_repo_name,
|
||||
self.repos.slackel_repo_name,
|
||||
self.repos.slint_repo_name
|
||||
]
|
||||
|
||||
self.repo = self.data[name][11]
|
||||
|
||||
def resolve(self) -> list:
|
||||
""" Resolve the dependencies. """
|
||||
required: list[str] = list(self.remove_deps(self.data[self.name][6].split()))
|
||||
|
||||
# Resolve dependencies for some special repos.
|
||||
if self.repo in self.special_repos:
|
||||
requires: list = []
|
||||
for req in required:
|
||||
if req in list(self.data.keys()):
|
||||
requires.append(req)
|
||||
|
||||
required.reverse()
|
||||
return list(dict.fromkeys(requires))
|
||||
|
||||
for req in required:
|
||||
sub_required: list[str] = list(self.remove_deps(self.data[req][6].split()))
|
||||
for sub in sub_required:
|
||||
required.append(sub)
|
||||
|
||||
required.reverse()
|
||||
|
||||
return list(dict.fromkeys(required))
|
||||
|
||||
def remove_deps(self, requires):
|
||||
|
|
Loading…
Add table
Reference in a new issue