Updated for queries

This commit is contained in:
Dimitris Zlatanidis 2023-04-08 16:56:07 +03:00
parent 93e7b29b9c
commit 60a1f7cdb9
2 changed files with 15 additions and 7 deletions

View file

@ -46,13 +46,19 @@ class Download(Configs):
for pkg in packages:
if self.utils.is_option(self.flag_bin_repository, self.flags):
mirror: str = BinQueries(pkg, repo).mirror()
location: str = BinQueries(pkg, repo).location()
package: str = BinQueries(pkg, repo).package_bin()
bin_repo_dict: dict = BinQueries(repo).repository_data()
package: str = bin_repo_dict[pkg][1]
mirror: str = bin_repo_dict[pkg][2]
location: str = bin_repo_dict[pkg][3]
urls.append(f'{mirror}{location}/{package}')
else:
location: str = SBoQueries(pkg).location()
sources = SBoQueries(pkg).sources()
sbo_repo_dict: dict = SBoQueries('').repository_data()
location: str = sbo_repo_dict[pkg][0]
if self.os_arch == 'x86_64' and sbo_repo_dict[pkg][4]:
sources = sbo_repo_dict[pkg][4].split()
else:
sources = sbo_repo_dict[pkg][3].split()
urls += sources
if self.repos.ponce_repo:

View file

@ -48,6 +48,7 @@ class ViewPackage(Configs):
def slackbuild(self, slackbuilds: list) -> None:
""" View the packages from the repository. """
slackbuilds: list = self.utils.apply_package_pattern(self.flags, slackbuilds)
sbo_repo_dict: dict = SBoQueries('').repository_data()
for sbo in slackbuilds:
@ -84,7 +85,7 @@ class ViewPackage(Configs):
deps: str = (', '.join([f'{self.cyan}{pkg}' for pkg in info[2].split()]))
if self.utils.is_option(self.flag_pkg_version, self.flags):
deps: str = (', '.join([f'{self.cyan}{pkg}{self.endc}-{self.yellow}{SBoQueries(pkg).version()}'
deps: str = (', '.join([f'{self.cyan}{pkg}{self.endc}-{self.yellow}{sbo_repo_dict[pkg][2]}'
f'{self.green}' for pkg in info[2].split()]))
print(f'Name: {self.green}{info[0]}{self.endc}\n'
@ -109,6 +110,7 @@ class ViewPackage(Configs):
def package(self, packages: list, repo: str) -> None:
packages: list = self.utils.apply_package_pattern(self.flags, packages, repo)
bin_repo_dict: dict = BinQueries(repo).repository_data()
for package in packages:
@ -137,7 +139,7 @@ class ViewPackage(Configs):
deps: str = (', '.join([f'{self.cyan}{pkg}' for pkg in info[9].split()]))
if self.utils.is_option(self.flag_pkg_version, self.flags):
deps: str = (', '.join([f'{self.cyan}{pkg}{self.endc}-{self.yellow}{BinQueries(pkg, repo).version()}'
deps: str = (', '.join([f'{self.cyan}{pkg}{self.endc}-{self.yellow}{bin_repo_dict[pkg][0]}'
f'{self.green}' for pkg in info[9].split()]))
print(f'Repository: {self.yellow}{info[0]}{self.endc}\n'