Updated for flag binaries

This commit is contained in:
Dimitris Zlatanidis 2023-03-27 22:30:00 +03:00
parent 6ea2b70591
commit 3b0e3d6e17

View file

@ -83,6 +83,7 @@ class Argparse(Configs):
self.flag_short_directory: str = '-z='
self.flag_searches: list = [self.flag_short_search, self.flag_search]
self.flag_binaries: list = [self.flag_short_bin_repository, self.flag_bin_repository]
self.options: list = [
self.flag_yes,
@ -275,8 +276,8 @@ class Argparse(Configs):
def check_for_bin_repositories(self) -> None:
""" Checks combination for binaries use repositories only and if repository exists. """
if (self.utils.is_option([self.flag_bin_repository, self.flag_short_bin_repository], self.flags)
and not self.utils.is_option([self.flag_bin_repository, self.flag_short_bin_repository], self.flags)):
if (self.utils.is_option(self.flag_binaries, self.flags)
and not self.utils.is_option(self.flag_binaries, self.flags)):
self.usage.help_minimal(f"{self.prog_name}: invalid options '{', '.join(self.flags)}'")
if (self.binary_repo and self.binary_repo not in self.repos.binaries_repositories_dict.keys()
@ -393,7 +394,7 @@ class Argparse(Configs):
title: str = f' Choose packages you want to {method} '
repo_packages: list = SBoQueries('').sbos()
if self.utils.is_option([self.flag_bin_repository, self.flag_short_bin_repository], self.flags):
if self.utils.is_option(self.flag_binaries, self.flags):
repo_packages: list = BinQueries('', self.binary_repo).all_name_packages()
installed: list = self.utils.installed_packages
@ -417,7 +418,7 @@ class Argparse(Configs):
inst_pkg: str = self.utils.is_package_installed(package)
split_inst_pkg: list = self.utils.split_binary_pkg(inst_pkg)
if self.utils.is_option([self.flag_bin_repository, self.flag_short_bin_repository], self.flags):
if self.utils.is_option(self.flag_binaries, self.flags):
repo_ver: str = BinQueries(package, self.binary_repo).version()
bin_pkg: str = BinQueries(package, self.binary_repo).package_bin()
repo_build_tag: str = self.utils.split_binary_pkg(bin_pkg[:-4])[3]
@ -430,7 +431,7 @@ class Argparse(Configs):
f'Available: {repo_ver} Build: {repo_build_tag}')]
else:
if self.utils.is_option([self.flag_bin_repository, self.flag_short_bin_repository], self.flags):
if self.utils.is_option(self.flag_binaries, self.flags):
for pkg in packages:
pkg_repo = BinQueries(pkg, self.binary_repo).package_name_repo()
@ -497,7 +498,7 @@ class Argparse(Configs):
print('\nEverything is up-to-date.\n')
raise SystemExit()
if self.utils.is_option([self.flag_bin_repository, self.flag_short_bin_repository], self.flags):
if self.utils.is_option(self.flag_binaries, self.flags):
install = Packages(packages, self.flags, self.binary_repo, mode=command)
install.execute()
else:
@ -582,7 +583,7 @@ class Argparse(Configs):
if self.utils.is_option(self.flag_searches, self.flags):
packages: list = self.choose_packages(packages, command)
if self.utils.is_option([self.flag_bin_repository, self.flag_short_bin_repository], self.flags):
if self.utils.is_option(self.flag_binaries, self.flags):
self.check.exists_in_the_database(packages, self.binary_repo)
install = Packages(packages, self.flags, self.binary_repo, mode=command)