mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-06 08:46:21 +01:00
Updated for options check
This commit is contained in:
parent
0ff17764f0
commit
ff624e3416
1 changed files with 6 additions and 4 deletions
|
@ -30,6 +30,8 @@ class Tracking(Configs):
|
|||
self.flag_pkg_version: list = ['-p', '--pkg-version']
|
||||
self.flag_bin_repository: list = ['-B', '--bin-repo=']
|
||||
|
||||
self.repo_for_binaries: bool = self.utils.is_option(['-B', '--bin-repo='], self.flags)
|
||||
|
||||
def packages(self, packages: list, repo: str) -> None:
|
||||
""" Prints the packages dependencies. """
|
||||
print(f"The list below shows the packages '{', '.join([p for p in packages])}' with dependencies:\n")
|
||||
|
@ -38,7 +40,7 @@ class Tracking(Configs):
|
|||
|
||||
packages: list = self.utils.apply_package_pattern(self.flags, packages, repo)
|
||||
|
||||
if self.utils.is_option(self.flag_bin_repository, self.flags):
|
||||
if self.repo_for_binaries:
|
||||
bin_repo_dict: dict = BinQueries(repo).repository_data()
|
||||
else:
|
||||
sbo_repo_dict: dict = SBoQueries().repository_data()
|
||||
|
@ -51,14 +53,14 @@ class Tracking(Configs):
|
|||
|
||||
if self.utils.is_option(self.flag_pkg_version, self.flags):
|
||||
|
||||
if self.utils.is_option(self.flag_bin_repository, self.flags):
|
||||
if self.repo_for_binaries:
|
||||
version: str = bin_repo_dict[package][0]
|
||||
else:
|
||||
version: str = sbo_repo_dict[package][2]
|
||||
|
||||
pkg = f'{self.yellow}{package} {version}{self.endc}'
|
||||
|
||||
if self.utils.is_option(self.flag_bin_repository, self.flags):
|
||||
if self.repo_for_binaries:
|
||||
requires: list = bin_repo_dict[package][6].split()
|
||||
else:
|
||||
requires: list = sbo_repo_dict[package][7].split()
|
||||
|
@ -76,7 +78,7 @@ class Tracking(Configs):
|
|||
|
||||
if self.utils.is_option(self.flag_pkg_version, self.flags):
|
||||
|
||||
if self.utils.is_option(self.flag_bin_repository, self.flags):
|
||||
if self.repo_for_binaries:
|
||||
version: str = f" {self.yellow}{bin_repo_dict[req][0]}{self.endc}"
|
||||
else:
|
||||
version: str = f" {self.yellow}{sbo_repo_dict[req][2]}{self.endc}"
|
||||
|
|
Loading…
Add table
Reference in a new issue