From f551ea8f527f1ff28039f446c47da82ab0dd11fd Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 13 Nov 2022 17:12:53 +0200 Subject: [PATCH 1/4] slpkg upgrade fails when a package is blacklisted #149 Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 4 ++++ slpkg/upgrade.py | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 714f8fc0..86e1b671 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +4.2.9 - 13/11/2022 +Bugfixed: +- slpkg upgrade fails when a package is blacklisted #149 + 4.2.8 - 06/11/2022 Updated: - Check the SBo script exists before patching the tag diff --git a/slpkg/upgrade.py b/slpkg/upgrade.py index db6547a1..95e00e9e 100644 --- a/slpkg/upgrade.py +++ b/slpkg/upgrade.py @@ -7,6 +7,7 @@ from distutils.version import LooseVersion from slpkg.configs import Configs from slpkg.queries import SBoQueries +from slpkg.blacklist import Blacklist @dataclass @@ -19,10 +20,11 @@ class Upgrade: print("Do not forget to run 'slpkg update' before.") repo_packages = SBoQueries('').names() + black = Blacklist().get() for pkg in os.listdir(self.log_packages): - if pkg.endswith(self.sbo_repo_tag): - inst_pkg_name = '-'.join(pkg.split('-')[:-3]) + inst_pkg_name = '-'.join(pkg.split('-')[:-3]) + if pkg.endswith(self.sbo_repo_tag) and inst_pkg_name not in black: if inst_pkg_name in repo_packages: installed_ver = pkg.replace(f'{inst_pkg_name}-', From f03bfe2cd0a32c01016207c61ab8120ac36e7c1b Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 13 Nov 2022 20:41:22 +0200 Subject: [PATCH 2/4] Updated for version 4.2.9 Signed-off-by: Dimitris Zlatanidis --- README.rst | 4 ++-- setup.cfg | 2 +- slpkg/version.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index e3fd5607..5c759f40 100644 --- a/README.rst +++ b/README.rst @@ -30,8 +30,8 @@ Install from the official third-party `SBo repository Date: Sat, 19 Nov 2022 11:22:20 +0200 Subject: [PATCH 3/4] Moved '%README%' to the blacklist Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 4 +++- configs/blacklist.yml | 2 +- slpkg/dependencies.py | 2 +- slpkg/view_package.py | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 86e1b671..f142e700 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,8 @@ -4.2.9 - 13/11/2022 +4.2.9 - 19/11/2022 Bugfixed: - slpkg upgrade fails when a package is blacklisted #149 +Updated: +- Moved '%README%' to the blacklist 4.2.8 - 06/11/2022 Updated: diff --git a/configs/blacklist.yml b/configs/blacklist.yml index e85b367d..decdc33a 100644 --- a/configs/blacklist.yml +++ b/configs/blacklist.yml @@ -1,4 +1,4 @@ blacklist: # Add packages and separate them with commas. - packages: [] + packages: ["%README%",] diff --git a/slpkg/dependencies.py b/slpkg/dependencies.py index ce180768..8fe89d80 100644 --- a/slpkg/dependencies.py +++ b/slpkg/dependencies.py @@ -17,7 +17,7 @@ class Requires: requires = SBoQueries(self.name).requires() for req in requires: - if req and req != '%README%': + if req: sub = SBoQueries(req).requires() for s in sub: requires.append(s) diff --git a/slpkg/view_package.py b/slpkg/view_package.py index 55fceae1..5fc922c7 100644 --- a/slpkg/view_package.py +++ b/slpkg/view_package.py @@ -43,6 +43,10 @@ class ViewPackage: readme = http.request( 'GET', f'{self.sbo_repo_url}/{info[9]}/{info[0]}/README') + info_file = http.request( + 'GET', f'{self.sbo_repo_url}/{info[9]}/{info[0]}/{info[0]}.info') + print(info_file) + print(f'Name: {GREEN}{info[0]}{ENDC}\n' f'Version: {GREEN}{info[1]}{ENDC}\n' f'Requires: {GREEN}{info[2]}{ENDC}\n' From 23bad6b86f895104cc2c2df4766cbb2f5d251892 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 19 Nov 2022 11:49:48 +0200 Subject: [PATCH 4/4] Added maintainer info in the view command #150 Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 2 ++ slpkg/view_package.py | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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}')