diff --git a/slpkg/binaries/install.py b/slpkg/binaries/install.py index 8e377fe7..abc5c82e 100644 --- a/slpkg/binaries/install.py +++ b/slpkg/binaries/install.py @@ -3,6 +3,7 @@ import os import time +import json from pathlib import Path from collections import OrderedDict @@ -158,6 +159,24 @@ class Packages(Configs): for package in self.binary_packages: command: str = f'{self.slackware_command} {self.tmp_slpkg}/{package}' self.multi_proc.run(command, package, self.progress_message) + name: str = self.utils.split_package(package)['name'] + self.write_deps_log(name) + + def write_deps_log(self, name: str) -> None: + deps: dict = {} + deps_logs: dict = {} + installed_requires: list = [] + requires: tuple = Required(self.data, name, self.flags).resolve() + # Verify for installation. + for req in requires: + if self.utils.is_package_installed(req): + installed_requires.append(req) + + deps[name] = installed_requires + if self.deps_log_file.is_file(): + deps_logs: dict = self.utils.read_json_file(self.deps_log_file) + deps_logs.update(deps) + self.deps_log_file.write_text(json.dumps(deps_logs, indent=4)) def set_progress_message(self) -> None: if self.mode == 'upgrade' or self.option_for_reinstall: