diff --git a/configs/slpkg.toml b/configs/slpkg.toml index 07296620..1d67aae3 100644 --- a/configs/slpkg.toml +++ b/configs/slpkg.toml @@ -1,6 +1,6 @@ # This is the general configuration file of slpkg: # /etc/slpkg/slpkg.toml -# Updated: 08/05/2024, Version: 5.0.8 +# Updated: 10/05/2024, Version: 5.0.8 [CONFIGS] @@ -33,6 +33,10 @@ CHECKSUM_MD5 = true # Default is true. [true/false] DIALOG = true +# View missing dependencies as main packages from the repository. +# Default is true. [true/false] +VIEW_MISSING_DEPS = true + # Choose ascii printable characters. # If true, it uses the extended characters, otherwise the basic ones. # Default is true. [true/false]. diff --git a/slpkg/configs.py b/slpkg/configs.py index a75a6758..0814356f 100644 --- a/slpkg/configs.py +++ b/slpkg/configs.py @@ -44,6 +44,7 @@ class Configs: # pylint: disable=[R0902] gpg_verification: bool = False checksum_md5: bool = True dialog: bool = True + view_missing_deps: bool = True downloader: str = 'wget' wget_options: str = '--c -q --progress=bar:force:noscroll --show-progress' curl_options: str = '' @@ -89,6 +90,7 @@ class Configs: # pylint: disable=[R0902] gpg_verification: bool = config['gpg_verification'] checksum_md5: bool = config['checksum_md5'] dialog: bool = config['dialog'] + view_missing_deps: bool = config['view_missing_deps'] downloader: str = config['downloader'] wget_options: str = config['wget_options'] curl_options: str = config['curl_options'] diff --git a/slpkg/dialog_configs.py b/slpkg/dialog_configs.py index 5087e267..100b0140 100644 --- a/slpkg/dialog_configs.py +++ b/slpkg/dialog_configs.py @@ -82,6 +82,7 @@ class FormConfigs(Configs): keys: list = [ 'COLORS', 'DIALOG', + 'VIEW_MISSING_DEPS', 'SILENT_MODE', 'ASCII_CHARACTERS', 'ASK_QUESTION', @@ -134,6 +135,7 @@ class FormConfigs(Configs): ('COLORS =', 'DIALOG =', + 'VIEW_MISSING_DEPS =', 'SILENT_MODE =', 'ASCII_CHARACTERS =', 'ASK_QUESTION =', diff --git a/slpkg/tracking.py b/slpkg/tracking.py index 7474c939..05222238 100644 --- a/slpkg/tracking.py +++ b/slpkg/tracking.py @@ -146,10 +146,11 @@ class Tracking(Configs): # pylint: disable=[R0902] self.package_requires: list = list(Requires(self.data, package, self.flags).resolve()) if self.package_requires: - requires: list = self.data[package]['requires'] - for req in requires: - if req not in self.data: - self.package_requires.append(req) + if self.view_missing_deps: + requires: list = self.data[package]['requires'] + for req in requires: + if req not in self.data: + self.package_requires.append(req) self.require_length: int = max(len(name) for name in self.package_requires) def view_summary_of_tracking(self, package: str) -> None: diff --git a/slpkg/views/views.py b/slpkg/views/views.py index e52de797..ad8ec4e5 100644 --- a/slpkg/views/views.py +++ b/slpkg/views/views.py @@ -334,17 +334,19 @@ class View(Configs): # pylint: disable=[R0902] def missing_dependencies(self, packages: list) -> None: """ View for missing dependencies. """ - missing_deps: dict = {} - for package in packages: - requires: list = self.data[package]['requires'] - for req in requires: - if req not in self.data: - missing_deps[package] = [req for req in requires if req not in self.data] - if missing_deps: - print('\nPackages with missing dependencies:') - for pkg, deps in missing_deps.items(): - print(f"> {self.cyan}{pkg}{self.endc}: Requires " - f"({len(deps)}) -> {self.red}{', '.join(deps)}{self.endc}") + if self.view_missing_deps: + missing_deps: dict = {} + for package in packages: + requires: list = self.data[package]['requires'] + for req in requires: + if req not in self.data: + missing_deps[package] = [req for req in requires if req not in self.data] + if missing_deps: + print('\nPackages with missing dependencies:') + for pkg, deps in missing_deps.items(): + if deps and deps != ['']: + print(f"> {self.cyan}{pkg}{self.endc}: Requires " + f"({len(deps)}) -> {self.red}{', '.join(deps)}{self.endc}") def question(self, message: str = 'Do you want to continue?') -> None: """ View a question.