Added write deps log for binaries

This commit is contained in:
Dimitris Zlatanidis 2024-03-21 12:21:25 +02:00
parent 6e30a1bcea
commit 2827d3e5c5

View file

@ -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: