Updated for values

This commit is contained in:
Dimitris Zlatanidis 2023-05-08 10:36:56 +03:00
parent 82d039d512
commit 515c3475f7

View file

@ -33,15 +33,25 @@ class ViewPackage(Configs):
for sbo in slackbuilds:
for name, value in data.items():
location: str = value[0]
files: str = value[1]
version: str = value[2]
download: str = value[3]
download_64: str = value[4]
md5sum: str = value[5]
md5sum_64: str = value[6]
requires: str = value[7]
description: str = value[8]
if sbo == name or sbo == '*':
path = Path(self.repos.repositories[self.repository][1], value[0], name, 'README')
path = Path(self.repos.repositories[self.repository][1], location, name, 'README')
readme = self.utils.read_file(path)
path = Path(self.repos.repositories[self.repository][1], value[0], name, f'{name}.info')
path = Path(self.repos.repositories[self.repository][1], location, name, f'{name}.info')
info_file = self.utils.read_file(path)
repo_build_tag = self.utils.read_sbo_build_tag(name, value[0])
repo_build_tag = self.utils.read_sbo_build_tag(name, location, self.repository)
mirror: str = self.repos.repositories[self.repository][2][0]
maintainer, email, homepage = '', '', ''
@ -53,26 +63,26 @@ class ViewPackage(Configs):
if line.startswith('EMAIL'):
email: str = line[7:-2].strip()
deps: str = (', '.join([f'{self.cyan}{pkg}' for pkg in value[7].split()]))
deps: str = (', '.join([f'{self.cyan}{pkg}' for pkg in requires.split()]))
if self.option_for_pkg_version:
deps: str = (', '.join([f'{self.cyan}{pkg}{self.endc} {self.yellow}{data[pkg][2]}'
f'{self.green}' for pkg in value[7].split()]))
f'{self.green}' for pkg in requires.split()]))
print(f'Name: {self.green}{name}{self.endc}\n'
f'Version: {self.green}{value[2]}{self.endc}\n'
f'Version: {self.green}{version}{self.endc}\n'
f'Build: {self.green}{repo_build_tag}{self.endc}\n'
f'Requires: {self.green}{deps}{self.endc}\n'
f'Homepage: {self.blue}{homepage}{self.endc}\n'
f'Download SlackBuild: {self.blue}{mirror}'
f'{value[0]}/{name}{repo_tar_suffix}{self.endc}\n'
f'Download sources: {self.blue}{value[3]}{self.endc}\n'
f'Download_x86_64 sources: {self.blue}{value[4]}{self.endc}\n'
f'Md5sum: {self.yellow}{value[5]}{self.endc}\n'
f'Md5sum_x86_64: {self.yellow}{value[6]}{self.endc}\n'
f'Files: {self.green}{value[1]}{self.endc}\n'
f'Description: {self.green}{value[8]}{self.endc}\n'
f'Category: {self.red}{value[0]}{self.endc}\n'
f'SBo url: {self.blue}{mirror}{value[0]}/{name}{self.endc}\n'
f'{location}/{name}{repo_tar_suffix}{self.endc}\n'
f'Download sources: {self.blue}{download}{self.endc}\n'
f'Download_x86_64 sources: {self.blue}{download_64}{self.endc}\n'
f'Md5sum: {self.yellow}{md5sum}{self.endc}\n'
f'Md5sum_x86_64: {self.yellow}{md5sum_64}{self.endc}\n'
f'Files: {self.green}{files}{self.endc}\n'
f'Description: {self.green}{description}{self.endc}\n'
f'Category: {self.red}{location}{self.endc}\n'
f'SBo url: {self.blue}{mirror}{location}/{name}{self.endc}\n'
f'Maintainer: {self.yellow}{maintainer}{self.endc}\n'
f'Email: {self.yellow}{email}{self.endc}\n'
f'\nREADME: {self.cyan}{"".join(readme)}{self.endc}')