Fixed dependencies order

This commit is contained in:
Dimitris Zlatanidis 2022-12-17 18:52:00 +02:00
parent ca1ef5d993
commit acd682ed21

View file

@ -38,12 +38,22 @@ class Slackbuilds:
if '--resolve-off' not in self.flags:
self.creating_dependencies_for_build()
self.creating_main_for_build()
self.view_before_build()
self.download_slackbuilds_and_build()
def creating_dictionary(self):
""" Dictionary with the main slackbuilds and dependencies. """
for sbo in self.slackbuilds:
self.sbos[sbo] = Requires(sbo).resolve()
def creating_main_for_build(self):
""" List with the main slackbuilds. """
[self.install_order.append(main) for main in self.sbos.keys()]
def view_before_build(self):
""" View slackbuilds before proceed. """
view = ViewMessage(self.flags)
@ -57,11 +67,6 @@ class Slackbuilds:
view.question()
def creating_dictionary(self):
""" Dictionary with the main slackbuilds and dependencies. """
for sbo in self.slackbuilds:
self.sbos[sbo] = Requires(sbo).resolve()
def creating_dependencies_for_build(self):
""" List with the dependencies. """
for deps in self.sbos.values():
@ -69,20 +74,16 @@ class Slackbuilds:
# Checks if the package was installed and skipped.
if ('--skip-installed' in self.flags and
self.utils.is_installed(f'{dep}-')):
self.utils.is_installed(dep)):
continue
if dep not in self.slackbuilds:
if dep not in self.sbos.values():
self.dependencies.append(dep)
# Remove duplicate packages and keeps the order.
self.dependencies = list(OrderedDict.fromkeys(self.dependencies))
self.install_order.extend(self.dependencies)
def creating_main_for_build(self):
""" List with the main slackbuilds. """
[self.install_order.append(main) for main in self.sbos.keys()]
def download_slackbuilds_and_build(self):
""" Downloads files and sources and starting the build. """
wget = Wget()