diff --git a/ChangeLog.txt b/ChangeLog.txt index f142e700..5e109acb 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -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: diff --git a/slpkg/view_package.py b/slpkg/view_package.py index 5fc922c7..f389b731 100644 --- a/slpkg/view_package.py +++ b/slpkg/view_package.py @@ -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}')