Added maintainer info in the view command #150

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2022-11-19 11:49:48 +02:00
parent 07a694c805
commit 23bad6b86f
2 changed files with 12 additions and 2 deletions

View file

@ -3,6 +3,8 @@ Bugfixed:
- slpkg upgrade fails when a package is blacklisted #149
Updated:
- Moved '%README%' to the blacklist
Added:
- Maintainer info in view command #150
4.2.8 - 06/11/2022
Updated:

View file

@ -45,7 +45,13 @@ class ViewPackage:
info_file = http.request(
'GET', f'{self.sbo_repo_url}/{info[9]}/{info[0]}/{info[0]}.info')
print(info_file)
maintainer, email = '', ''
for line in info_file.data.decode().splitlines():
if line.startswith('MAINTAINER'):
maintainer = line[12:-1].strip()
if line.startswith('EMAIL'):
email = line[7:-1].strip()
print(f'Name: {GREEN}{info[0]}{ENDC}\n'
f'Version: {GREEN}{info[1]}{ENDC}\n'
@ -58,4 +64,6 @@ class ViewPackage:
f'Files: {GREEN}{info[7]}{ENDC}\n'
f'Description: {GREEN}{info[8]}{ENDC}\n'
f'SBo url: {BLUE}{self.sbo_repo_url}/{info[9]}/{info[0]}{ENDC}\n'
f'README: {CYAN}{readme.data.decode()}{ENDC}')
f'Maintainer: {BLUE}{maintainer}{ENDC}\n'
f'Email: {BLUE}{email}{ENDC}\n'
f'\nREADME: {CYAN}{readme.data.decode()}{ENDC}')