mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Updated for sbo queries
This commit is contained in:
parent
5bb3d19072
commit
a21d79fff4
12 changed files with 14 additions and 14 deletions
|
@ -50,7 +50,7 @@ class Dependees(Configs):
|
||||||
if self.utils.is_option(self.flag_bin_repository, self.flags):
|
if self.utils.is_option(self.flag_bin_repository, self.flags):
|
||||||
self.bin_repo_dict: dict = BinQueries(repo).repository_data()
|
self.bin_repo_dict: dict = BinQueries(repo).repository_data()
|
||||||
else:
|
else:
|
||||||
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
|
self.sbo_repo_dict: dict = SBoQueries().repository_data()
|
||||||
|
|
||||||
for pkg in self.packages:
|
for pkg in self.packages:
|
||||||
dependees: list = list(self.find_requires(pkg))
|
dependees: list = list(self.find_requires(pkg))
|
||||||
|
|
|
@ -53,7 +53,7 @@ class Download(Configs):
|
||||||
location: str = bin_repo_dict[pkg][3]
|
location: str = bin_repo_dict[pkg][3]
|
||||||
urls.append(f'{mirror}{location}/{package}')
|
urls.append(f'{mirror}{location}/{package}')
|
||||||
else:
|
else:
|
||||||
sbo_repo_dict: dict = SBoQueries('').repository_data()
|
sbo_repo_dict: dict = SBoQueries().repository_data()
|
||||||
location: str = sbo_repo_dict[pkg][0]
|
location: str = sbo_repo_dict[pkg][0]
|
||||||
if self.os_arch == 'x86_64' and sbo_repo_dict[pkg][4]:
|
if self.os_arch == 'x86_64' and sbo_repo_dict[pkg][4]:
|
||||||
sources = sbo_repo_dict[pkg][4].split()
|
sources = sbo_repo_dict[pkg][4].split()
|
||||||
|
|
|
@ -288,7 +288,7 @@ class Argparse(Configs):
|
||||||
if self.utils.is_option(self.flag_binaries, self.flags):
|
if self.utils.is_option(self.flag_binaries, self.flags):
|
||||||
self.bin_repo_dict: dict = BinQueries(self.binary_repo).repository_data()
|
self.bin_repo_dict: dict = BinQueries(self.binary_repo).repository_data()
|
||||||
else:
|
else:
|
||||||
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
|
self.sbo_repo_dict: dict = SBoQueries().repository_data()
|
||||||
|
|
||||||
self.check = Check(self.flags, self.sbo_repo_dict, self.bin_repo_dict)
|
self.check = Check(self.flags, self.sbo_repo_dict, self.bin_repo_dict)
|
||||||
self.check.is_blacklist(self.args[1:])
|
self.check.is_blacklist(self.args[1:])
|
||||||
|
|
|
@ -61,7 +61,7 @@ class RepoInfo(Configs):
|
||||||
|
|
||||||
if value[0]:
|
if value[0]:
|
||||||
if repo in [self.repos.sbo_repo_name, self.repos.ponce_repo_name]:
|
if repo in [self.repos.sbo_repo_name, self.repos.ponce_repo_name]:
|
||||||
count = int(SBoQueries('').count_packages())
|
count = int(SBoQueries().count_packages())
|
||||||
else:
|
else:
|
||||||
count = int(BinQueries(repo).count_packages())
|
count = int(BinQueries(repo).count_packages())
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ class Requires:
|
||||||
def __init__(self, name: str):
|
def __init__(self, name: str):
|
||||||
__slots__ = 'name'
|
__slots__ = 'name'
|
||||||
self.name: str = name
|
self.name: str = name
|
||||||
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
|
self.sbo_repo_dict: dict = SBoQueries().repository_data()
|
||||||
|
|
||||||
def resolve(self) -> list:
|
def resolve(self) -> list:
|
||||||
""" Resolve the dependencies. """
|
""" Resolve the dependencies. """
|
||||||
|
|
|
@ -13,7 +13,7 @@ from slpkg.models.models import SBoTable, PonceTable
|
||||||
class SBoQueries(Configs):
|
class SBoQueries(Configs):
|
||||||
""" Queries class for the sbo repository. """
|
""" Queries class for the sbo repository. """
|
||||||
|
|
||||||
def __init__(self, name: str):
|
def __init__(self, name=None):
|
||||||
__slots__ = 'name'
|
__slots__ = 'name'
|
||||||
super(Configs, self).__init__()
|
super(Configs, self).__init__()
|
||||||
self.name: str = name
|
self.name: str = name
|
||||||
|
|
|
@ -67,7 +67,7 @@ class SearchPackage(Configs):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Searching for slackbuilds.
|
# Searching for slackbuilds.
|
||||||
sbo_repos_dict: dict = SBoQueries('').repository_data()
|
sbo_repos_dict: dict = SBoQueries().repository_data()
|
||||||
names: list = list(sbo_repos_dict.keys())
|
names: list = list(sbo_repos_dict.keys())
|
||||||
for package in packages:
|
for package in packages:
|
||||||
for name in names:
|
for name in names:
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Tracking(Configs):
|
||||||
if self.utils.is_option(self.flag_bin_repository, self.flags):
|
if self.utils.is_option(self.flag_bin_repository, self.flags):
|
||||||
bin_repo_dict: dict = BinQueries(repo).repository_data()
|
bin_repo_dict: dict = BinQueries(repo).repository_data()
|
||||||
else:
|
else:
|
||||||
sbo_repo_dict: dict = SBoQueries('').repository_data()
|
sbo_repo_dict: dict = SBoQueries().repository_data()
|
||||||
|
|
||||||
char: str = f' {self.llc}{self.hl}'
|
char: str = f' {self.llc}{self.hl}'
|
||||||
sp: str = ' ' * 4
|
sp: str = ' ' * 4
|
||||||
|
|
|
@ -32,7 +32,7 @@ class Upgrade(Configs):
|
||||||
if self.repo_for_binaries:
|
if self.repo_for_binaries:
|
||||||
self.bin_repo_dict: dict = BinQueries(self.repo).repository_data()
|
self.bin_repo_dict: dict = BinQueries(self.repo).repository_data()
|
||||||
else:
|
else:
|
||||||
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
|
self.sbo_repo_dict: dict = SBoQueries().repository_data()
|
||||||
|
|
||||||
logging.basicConfig(filename=str(LoggingConfig.log_file),
|
logging.basicConfig(filename=str(LoggingConfig.log_file),
|
||||||
filemode='w',
|
filemode='w',
|
||||||
|
|
|
@ -113,7 +113,7 @@ class Utilities:
|
||||||
def read_sbo_build_tag(self, sbo: str) -> str:
|
def read_sbo_build_tag(self, sbo: str) -> str:
|
||||||
""" Returns build tag from .SlackBuild file. """
|
""" Returns build tag from .SlackBuild file. """
|
||||||
build: str = ''
|
build: str = ''
|
||||||
sbo_repo_dict: dict = SBoQueries('').repository_data()
|
sbo_repo_dict: dict = SBoQueries().repository_data()
|
||||||
location: str = sbo_repo_dict[sbo][0]
|
location: str = sbo_repo_dict[sbo][0]
|
||||||
|
|
||||||
sbo_script = Path(self.repos.sbo_repo_path, location, sbo, f'{sbo}.SlackBuild')
|
sbo_script = Path(self.repos.sbo_repo_path, location, sbo, f'{sbo}.SlackBuild')
|
||||||
|
@ -202,7 +202,7 @@ class Utilities:
|
||||||
bin_repo_dict: dict = BinQueries(repo).repository_data()
|
bin_repo_dict: dict = BinQueries(repo).repository_data()
|
||||||
packages += list(bin_repo_dict.keys())
|
packages += list(bin_repo_dict.keys())
|
||||||
else:
|
else:
|
||||||
sbo_repo_dict: dict = SBoQueries('').repository_data()
|
sbo_repo_dict: dict = SBoQueries().repository_data()
|
||||||
packages += list(sbo_repo_dict.keys())
|
packages += list(sbo_repo_dict.keys())
|
||||||
|
|
||||||
return packages
|
return packages
|
||||||
|
|
|
@ -49,7 +49,7 @@ class ViewPackage(Configs):
|
||||||
def slackbuild(self, slackbuilds: list) -> None:
|
def slackbuild(self, slackbuilds: list) -> None:
|
||||||
""" View the packages from the repository. """
|
""" View the packages from the repository. """
|
||||||
slackbuilds: list = self.utils.apply_package_pattern(self.flags, slackbuilds)
|
slackbuilds: list = self.utils.apply_package_pattern(self.flags, slackbuilds)
|
||||||
sbo_repo_dict: dict = SBoQueries('').repository_data()
|
sbo_repo_dict: dict = SBoQueries().repository_data()
|
||||||
|
|
||||||
for sbo in slackbuilds:
|
for sbo in slackbuilds:
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ class ViewMessage(Configs):
|
||||||
if self.utils.is_option(self.flag_bin_repository, flags):
|
if self.utils.is_option(self.flag_bin_repository, flags):
|
||||||
self.bin_repo_dict: dict = BinQueries(self.repo).repository_data()
|
self.bin_repo_dict: dict = BinQueries(self.repo).repository_data()
|
||||||
else:
|
else:
|
||||||
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
|
self.sbo_repo_dict: dict = SBoQueries().repository_data()
|
||||||
|
|
||||||
def view_packages(self, package: str, mode: str) -> None:
|
def view_packages(self, package: str, mode: str) -> None:
|
||||||
""" Printing the main packages. """
|
""" Printing the main packages. """
|
||||||
|
@ -62,7 +62,7 @@ class ViewMessage(Configs):
|
||||||
repo: str = self.repo
|
repo: str = self.repo
|
||||||
else:
|
else:
|
||||||
version: str = self.sbo_repo_dict[package][2]
|
version: str = self.sbo_repo_dict[package][2]
|
||||||
repo: str = SBoQueries('').repo_name()
|
repo: str = SBoQueries().repo_name()
|
||||||
|
|
||||||
if mode in ['install', 'download']:
|
if mode in ['install', 'download']:
|
||||||
color: str = self.cyan
|
color: str = self.cyan
|
||||||
|
|
Loading…
Add table
Reference in a new issue